block_reduce_hdu

gammapy.image.block_reduce_hdu(input_hdu, block_size, func, cval=0)[source]

Provides block reduce functionality for image HDUs.

See http://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.block_reduce

Parameters:

image_hdu : ImageHDU

Original image HDU, unscaled

block_size : ndarray

Array containing down-sampling integer factor along each axis.

func : callable

Function object which is used to calculate the return value for each local block. This function must implement an axis parameter such as numpy.sum or numpy.mean.

cval : float, optional

Constant padding value if image is not perfectly divisible by the block size. Default 0.

Returns:

image_hdu : ImageHDU

Rebinned Image HDU