ptypy.utils.array_utils.rebin_2d#

ptypy.utils.array_utils.rebin_2d(A, rebin=1)#

Rebins array A symmetrically along the last 2 axes with factor rebin.

Parameters:
  • A (array-like) – input array, must be at least two-dimensional.

  • rebin (int) – rebin factor, rebin=2 means that a square of 4 pixels will be binned into one.

Returns:

out – rebinned array. Note that data type casting follows numpy rules, so that boolean arrays are converted to int.

Return type:

ndarray

See also

rebin