ess.reduce.normalization.normalize_by_monitor_histogram#

ess.reduce.normalization.normalize_by_monitor_histogram(detector, *, monitor, uncertainty_broadcast_mode, skip_range_check=False)[source]#

Normalize detector data by a normalized histogrammed monitor.

This normalization accounts for both the (wavelength) profile of the incident beam and the integrated neutron flux, meaning measurement duration and source strength.

  • For event detectors, the monitor values are mapped to the detector using scipp.lookup(). That is, for detector event \(d_i\), \(m_i\) is the monitor bin value at the same coordinate.

  • For histogram detectors, the monitor is generally rebinned using the detector binning using scipp.rebin(). Thus, detector value \(d_i\) and monitor value \(m_i\) correspond to the same bin.

    • In case the detector coordinate does not have a dimension in common with the monitor, scipp.lookup() is used as in the event case.

In both cases, let \(x_i\) be the lower bound of monitor bin \(i\) and let \(\Delta x_i = x_{i+1} - x_i\) be the width of that bin.

The detector is normalized according to

\[d_i^\text{Norm} = \frac{d_i}{m_i} \Delta x_i\]
Parameters:
  • detector (DataArray) – Input detector data. Must have a coordinate named monitor.dim, that is, the single dimension name of the monitor.

  • monitor (DataArray) – A histogrammed monitor. Must be one-dimensional and have a dimension coordinate, typically “wavelength”.

  • uncertainty_broadcast_mode (UncertaintyBroadcastMode) – Choose how uncertainties of the monitor are broadcast to the sample data.

  • skip_range_check (bool, default: False) –

    If false (default), the detector data must be within the range of the monitor coordinate. Set this to true to disable the check. The value of out-of-range bins / events is undefined in that case.

    This is useful when the detector contains data outside the monitor range, and it is difficult or impossible to slice the detector without also removing in-range data. In this case, the caller can mask those data points and skip the range check. normalize_by_monitor_histogram does not take masks into account when checking ranges as that is expensive to implement in a general case.

Returns:

DataArraydetector normalized by monitor. If the monitor has masks or contains non-finite values, the output has a mask called ‘_monitor_mask’ constructed from the monitor masks and non-finite values.

See also

normalize_by_monitor_integrated

Normalize by an integrated monitor.