scippneutron.tof.unwrap.maybe_clip_detector_subframes#
- scippneutron.tof.unwrap.maybe_clip_detector_subframes(frame, ltotal, chopper_cascade_frames)[source]#
Check for time overlap between subframes. If overlap is found, we clip away the regions where there is overlap. This is done by adding a fake chopper which is closed during the overlapping times.
Examples:
1. partial overlap: |-------------| -> |--------| |-------------| -> |--------| 2. total overlap: |----------------------| -> |--------| |-----| |-------| ->
In the case of multiple detector pixels, we find the pixel closest to the source and use that as the reference for the clipping. Because we are removing the entire region where overlap occurs, we are inserting a gap between subframes. The gap starts at the start of subframe n+1 and ends at the end of subframe n. The distance it would take for the gap to be entirely filled again with overlap is usually greater than the range of pixel distances (some edge cases are possible).
TODO: We currently do not handle the case where there is overlap between subframes at the detector farthest from the source, and no overlap at the detector closest to the source. Although rare, this is not impossible.
- Parameters:
frame (
tof.unwrap.FrameAtDetector
(scippneutron.tof.chopper_cascade.Frame
)) – The frame at the detector, with subframes that may overlap.ltotal (
tof.unwrap.Ltotal
(scipp.Variable
)) – The total distance between the source and the detector.chopper_cascade_frames (
tof.unwrap.ChopperCascadeFrames
(scippneutron.tof.chopper_cascade.FrameSequence
)) – All the frames in the chopper cascade, before the detector.
- Return type:
tof.unwrap.CleanFrameAtDetector
(scippneutron.tof.chopper_cascade.Frame
)