ess.powder.grouping.focus_data_dspacing_and_two_theta#
- ess.powder.grouping.focus_data_dspacing_and_two_theta(data, dspacing_bins, two_theta_bins, keep_events)[source]#
Reduce the pixel-based data to d-spacing and two-theta dimensions.
The two-theta binning is finer than
TwoThetaBinsand covers the full two-theta range of the detector, not only the requested range. Both are necessary to have sufficient wavelength resolution when performing a monitor normalization in a follow-up workflow step. The bins are nevertheless aligned withTwoThetaBinssuch thatgroup_two_theta()can produce the requested binning exactly, see_focussing_two_theta_bins().- Parameters:
data (
CorrectedDetector[TypeVar(RunType,ess.reduce.nexus.types.SampleRun(int),ess.powder.types.VanadiumRun(int),ess.powder.types.EmptyCanRun(int))]) – The input data to be reduced, which must have ‘wavelength’, ‘dspacing’, ‘two_theta’ coordinates.dspacing_bins (
ess.powder.types.DspacingBins(scipp.Variable)) – The bins to use for the d-spacing dimension.two_theta_bins (
ess.powder.types.TwoThetaBins(types.scipp._scipp.core.Variable | None)) – The two-theta bins requested for the final result, orNoneif the data will not be grouped by two-theta.keep_events (
KeepEvents[TypeVar(RunType,ess.reduce.nexus.types.SampleRun(int),ess.powder.types.VanadiumRun(int),ess.powder.types.EmptyCanRun(int))]) – Whether to keep the events in the output. If False, the output will be histogrammed instead of binned.
- Returns:
CorrectedDspacing[TypeVar(RunType,ess.reduce.nexus.types.SampleRun(int),ess.powder.types.VanadiumRun(int),ess.powder.types.EmptyCanRun(int))] – The reduced data with ‘dspacing’ and ‘two_theta’ dimensions.