Skip to content

Commit

Permalink
Relax conditions when interpolating between frames and time of flight (
Browse files Browse the repository at this point in the history
…#701)

* Relax conditions when creating time of flight interpolators to allow time of flight frames to start from zero.
  • Loading branch information
toastisme committed Mar 5, 2024
1 parent 152fdb8 commit 7964d4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions newsfragments/701.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Relax conditions when creating time of flight interpolators to allow time of flight frames to start from zero.
8 changes: 4 additions & 4 deletions src/dxtbx/model/tof_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def frame_to_tof_interpolator(frames: List[float], tof: List[float]) -> interp1d
ToF can vary nonlinearly with frame number.
A cubic spline is used to better account for these cases.
"""
assert min(frames) > 0
assert min(tof) > 0
assert min(frames) >= 0
assert min(tof) >= 0
assert len(frames) == len(tof)
assert all(i < j for i, j in zip(frames, frames[1:]))
assert all(i < j for i, j in zip(tof, tof[1:]))
Expand All @@ -40,8 +40,8 @@ def tof_to_frame_interpolator(tof: List[float], frames: List[float]) -> interp1d
ToF can vary nonlinearly with frame number.
A cubic spline is used to better account for these cases.
"""
assert min(frames) > 0
assert min(tof) > 0
assert min(frames) >= 0
assert min(tof) >= 0
assert len(frames) == len(tof)
assert all(i < j for i, j in zip(frames, frames[1:]))
assert all(i < j for i, j in zip(tof, tof[1:]))
Expand Down

0 comments on commit 7964d4b

Please sign in to comment.