Previous topic

SamPy.image.manipulation.congrid

Next topic

SamPy.image.manipulation.gaussianKernel

This Page

SamPy.image.manipulation.frebin

SamPy.image.manipulation.frebin(image, nsout, nlout=1, total=False)

Shrink or expand the size of an array an arbitary amount using interpolation. Conserves flux by ensuring that each input pixel is equally represented in the output array.

Todo :

one could do the binning faster if old and new outputs are modulo 0

Note :

modelled after the IDL code frebin.pro, so this may not be the fastest solution

Parameters:
  • image – input image, 1-d or 2-d ndarray
  • nsout – number of samples in the output image, numeric scalar
  • nlout – number of lines (ydir) in the output image, numeric scalar
  • total – Use of the total conserves surface flux. If True, the output pixels will be the sum of pixels within the appropriate box of the input image. Otherwise they will be the average.
Returns:

binned array

Return type:

ndarray