scippneutron.chopper.filtering.collapse_plateaus#

scippneutron.chopper.filtering.collapse_plateaus(plateaus, *, coord='time')[source]#

Merge plateaus bins into dense data.

Useful for post-processing the result of scippneutron.chopper.find_plateaus. Averages the bins and turns the given event coordinate into a bin-edge coordinate.

Parameters:
  • plateaus (DataArray) – Data that has been binned into plateaus.

  • coord (str, default: 'time') – Name of the constructed bin-edge coordinate.

Returns:

DataArray – Dense data with one element per plateau.

See also

scippneutron.chopper.filtering.find_plateaus

Function to construct suitable input data.