ess.sans.i_of_q.preprocess_monitor_data#

ess.sans.i_of_q.preprocess_monitor_data(monitor, wavelength_bins, non_background_range, uncertainties)[source]#

Prepare monitor data for computing the transmission fraction. The input data are first converted to wavelength (if needed). If a non_background_range is provided, it defines the region where data is considered not to be background, and regions outside are background. A mean background level will be computed from the background and will be subtracted from the non-background counts. Finally, if wavelength bins are provided, the data is rebinned to match the requested binning.

Parameters:
  • monitor (WavelengthMonitor[TypeVar(RunType, ess.reduce.nexus.types.BackgroundRun (int), ess.reduce.nexus.types.EmptyBeamRun (int), ess.reduce.nexus.types.SampleRun (int), TransmissionRun[ess.reduce.nexus.types.SampleRun (int)], TransmissionRun[ess.reduce.nexus.types.BackgroundRun (int)], ess.reduce.nexus.types.VanadiumRun (int)), TypeVar(MonitorType, ess.reduce.nexus.types.Monitor1 (int), ess.reduce.nexus.types.Monitor2 (int), ess.reduce.nexus.types.Monitor3 (int), ess.reduce.nexus.types.Monitor4 (int), ess.reduce.nexus.types.Monitor5 (int), ess.reduce.nexus.types.IncidentMonitor (int), ess.reduce.nexus.types.TransmissionMonitor (int))]) – The monitor to be pre-processed.

  • wavelength_bins (types.WavelengthBins (scipp.Variable)) – The binning in wavelength to use for the rebinning.

  • non_background_range (types.NonBackgroundWavelengthRange (types.scipp._scipp.core.Variable | None)) – The range of wavelengths that defines the data which does not constitute background. Everything outside this range is treated as background counts.

  • uncertainties (UncertaintyBroadcastMode) – The mode for broadcasting uncertainties. See ess.reduce.uncertainty.UncertaintyBroadcastMode for details.

Returns:

CleanMonitor[TypeVar(RunType, ess.reduce.nexus.types.BackgroundRun (int), ess.reduce.nexus.types.EmptyBeamRun (int), ess.reduce.nexus.types.SampleRun (int), TransmissionRun[ess.reduce.nexus.types.SampleRun (int)], TransmissionRun[ess.reduce.nexus.types.BackgroundRun (int)], ess.reduce.nexus.types.VanadiumRun (int)), TypeVar(MonitorType, ess.reduce.nexus.types.Monitor1 (int), ess.reduce.nexus.types.Monitor2 (int), ess.reduce.nexus.types.Monitor3 (int), ess.reduce.nexus.types.Monitor4 (int), ess.reduce.nexus.types.Monitor5 (int), ess.reduce.nexus.types.IncidentMonitor (int), ess.reduce.nexus.types.TransmissionMonitor (int))] – The input monitors converted to wavelength, cleaned of background counts, and rebinned to the requested wavelength binning.