arpes.analysis.general.rebin#

arpes.analysis.general.rebin(data, shape=None, bin_width=None, method='sum', **kwargs)[source]#

Rebins the data onto a different (smaller) shape.

(xarray groupby_bins is used internally)

By default the behavior is to split the data into chunks that are integrated over.

When both shape and bin_width are supplied, shape is used.

Dimensions corresponding to missing entries in shape or reduction will not be changed

Parameters:
  • data – ARPES data

  • shape (dict[str, int]) – Target shape (key is dimension (coords) name, the value is the size of the coords after rebinning.) The priority is higher than that of the reduction argument.

  • bin_width (dict[str, int]) – Factor to reduce each dimension by The dict key is dimension name and it’s value is the binning width in pixel.

  • method – sum or mean after groupby_bins (default sum)

  • **kwargs – Treated as bin_width. Like as eV=2, phi=3 to set.

Returns:

The rebinned data.