prepare_data

prepare_data.combine_pixels(ifu_data: ndarray, scale_factor: int)

Rebin the IFU data by combining pixels based on the given scale factor.

This function takes the original IFU data and re-bins it by combining the pixels in blocks of size scale_factor x scale_factor. The resulting data has reduced height and width, and the pixel values are the sum of the corresponding original pixels.

Parameters

ifu_datanp.ndarray

The original IFU data with shape (spectra, height, width).

scale_factorint

The factor by which to reduce the resolution of the IFU data by combining scale_factor x scale_factor blocks.

Returns

np.ndarray

The re-binned IFU data with reduced height and width.

Examples

>>> new_ifu_data = combine_pixels(ifu_data, 2)