scippneutron.tof.unwrap#

This module provides functionality for unwrapping raw frames of neutron time-of-flight data.

The module handles standard unwrapping, unwrapping in pulse-skipping mode, and unwrapping for WFM instruments, as well as combinations of the latter two. The functions defined here are meant to be used as providers for a Sciline pipeline. See https://scipp.github.io/sciline/ on how to use Sciline.

Module Attributes

Choppers

Choppers used to define the frame parameters.

ChopperCascadeFrames

Frames of the chopper cascade.

FrameAtDetector

Result of passing the source pulse through the chopper cascade to the detector.

FramePeriod

The period of a frame, a (small) integer multiple of the source period.

UnwrappedTimeOfArrival

Time of arrival of the neutron at the detector, unwrapped at the pulse period.

FrameAtDetectorStartTime

Time of the start of the frame at the detector.

UnwrappedTimeOfArrivalMinusStartTime

Time of arrival of the neutron at the detector, unwrapped at the pulse period, minus the start time of the frame.

TimeOfArrivalMinusStartTimeModuloPeriod

Time of arrival of the neutron at the detector minus the start time of the frame, modulo the frame period.

TofCoord

Tof coordinate computed by the workflow.

Ltotal

Total distance between the source and the detector(s).

PulsePeriod

Period of the source pulses, i.e., time between consecutive pulse starts.

PulseStride

Stride of used pulses.

PulseStrideOffset

When pulse-skipping, the offset of the first pulse in the stride.

RawData

Raw detector data loaded from a NeXus file, e.g., NXdetector containing NXevent_data.

SourceTimeRange

Time range of the source pulse, used for computing frame bounds.

SourceWavelengthRange

Wavelength range of the source pulse, used for computing frame bounds.

TofData

Detector data with time-of-flight coordinate.

ReHistogrammedTofData

Detector data with time-of-flight coordinate, re-histogrammed.

Functions

chopper_cascade_frames(...)

Return the frames of the chopper cascade.

frame_at_detector(frames, ltotal, period)

Return the frame at the detector.

frame_at_detector_start_time(frame)

Compute the start time of the frame at the detector.

frame_period(pulse_period, pulse_stride)

Return the period of a frame, which is defined by the pulse period times the pulse stride.

params()

providers()

re_histogram_tof_data(da)

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).

relation_between_time_of_arrival_and_tof(...)

Compute the slope and intercept of a linear relationship between time-of-arrival and tof, which can be used to create lookup tables which can give the time-of-flight from the time-of-arrival.

time_of_arrival_minus_start_time_modulo_period(...)

Compute the time of arrival of the neutron at the detector, unwrapped at the pulse period, minus the start time of the frame, modulo the frame period.

time_of_flight_data(da, tof)

Add the time-of-flight coordinate to the data.

time_of_flight_from_lookup(toa, toa_to_tof)

Compute the time-of-flight from the time-of-arrival.

unwrapped_time_of_arrival(da, offset, period)

Compute the unwrapped time of arrival of the neutron at the detector.

unwrapped_time_of_arrival_minus_frame_start_time(...)

Compute the time of arrival of the neutron at the detector, unwrapped at the pulse period, minus the start time of the frame.

Classes

TimeOfArrivalToTimeOfFlight(slope, intercept)