scippneutron.tof.unwrap.re_histogram_tof_data#
- scippneutron.tof.unwrap.re_histogram_tof_data(da)[source]#
Histogrammed data that has been converted to tof will typically have unsorted bin edges (due to either wrapping of time_of_flight or wavelength overlap between subframes). This function re-histograms the data to ensure that the bin edges are sorted. It makes use of the
to_events
helper which generates a number of events in each bin with a uniform distribution. The new events are then histogrammed using a set of sorted bin edges.WARNING: This function is highly experimental, has limitations and should be used with caution. It is a workaround to the issue that rebinning data with unsorted bin edges is not supported in scipp. We also do not support variances on the data. As such, this function is not part of the default set of providers, and needs to be inserted manually into the workflow.
- Parameters:
da (
tof.unwrap.TofData
(scipp.DataArray
)) – TofData with the time-of-flight coordinate.- Return type: