Skip to content

Commit

Permalink
Add raise for reversed time direction, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Mar 5, 2024
1 parent 3423e7e commit a8c2fb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/lsst/summit/utils/auxtel/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def hasTimebaseErrors(expRecord, client, maxDiff=1.05):
The EFD client to use.
maxDiff : `float`, optional
The maximum difference in cRIO timestamps to consider as a timebase
error.
error, in seconds. The correct spacing is 1s, so 1.05 denotes a 50ms
difference when the jitter should be on the order of microseconds.
Returns
-------
Expand All @@ -71,4 +72,8 @@ def hasTimebaseErrors(expRecord, client, maxDiff=1.05):
)
return False

return np.max(np.diff(cRIOtimestamps.values)) > maxDiff
diff = np.diff(cRIOtimestamps.values)
if np.min(diff) < 0:
raise ValueError("cRIO timestamps are not monotonically increasing - time is running backwards!")

return np.max(diff) > maxDiff

0 comments on commit a8c2fb6

Please sign in to comment.