block_replicate¶
-
ccdproc.
block_replicate
(ccd, block_size, conserve_sum=True)[source]¶ Thin wrapper around
astropy.nddata.block_replicate
. Upsample a data array by block replication.Parameters: data : array_like
The data to be block replicated.
block_size : int or array_like (int)
The integer block size along each axis. If
block_size
is a scalar anddata
has more than one dimension, thenblock_size
will be used for for every axis.conserve_sum : bool, optional
If
True
(the default) then the sum of the output block-replicated data will equal the sum of the inputdata
.Returns: output : array_like
The block-replicated data.
Examples
>>> import numpy as np >>> from astropy.nddata.utils import block_replicate >>> data = np.array([[0., 1.], [2., 3.]]) >>> block_replicate(data, 2) array([[ 0. , 0. , 0.25, 0.25], [ 0. , 0. , 0.25, 0.25], [ 0.5 , 0.5 , 0.75, 0.75], [ 0.5 , 0.5 , 0.75, 0.75]])
>>> block_replicate(data, 2, conserve_sum=False) array([[ 0., 0., 1., 1.], [ 0., 0., 1., 1.], [ 2., 2., 3., 3.], [ 2., 2., 3., 3.]])