rebin

jwst.emicorr.emicorr.rebin(arr, newshape)[source]

Rebin an array to a new shape.

Rebinned values are taken from the input at nearest-neighbor indices. No interpolation is performed. If a value falls between two input pixels, the smaller index value is used.

Parameters:
arrndarray

Array to rebin.

newshapelist or tuple

New shape for the input array.

Returns:
arrndarray

Rebinned array.

Notes

The intent for this function is to replicate the behavior of the IDL function congrid, without the /INTERP flag.