-
Notifications
You must be signed in to change notification settings - Fork 1
Time-of-flight: use epoch reference time and guess the PulseStrideOffset #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This might be a silly question, but what is Edit: aha got it, it's the index of the pulse in the pulse skipping frame Isn't |
Are you asking why do I need to subtract epoch from the minimum event_time_zero? |
|
Would we get the same result by doing or am I missing something? If possible I think it's simpler to not mix in the concept of an |
|
We can't simply use the minimum time because of #180 (comment) I added a comment to clarify this. |
That makes sense 👍 So essentially the solution is: Instead of assuming the minimum event time zero coincides with a pulse skipping frame start, we assume that the first pulse time after |
|
Not really. It's more that we find a global reference time for everyone, which will give us consistent pulse index 0 or 1 depending on the pulse (even if there are skipped pulses with no data). Whether or not it corresponds to the start of a frame or in the middle of a frame is resolved by the pulse_stride_offset guesswork. |
|
Aha I see. Pulse index 0 doesn't necessarily meant it's the first pulse of a pulse skipping frame 👍 |
jokasimr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
In this PR, we use epoch to create a reference time for computing
pulse_index.The method is
We also add a simple method to guess the
PulseStrideOffsetparameter, as using a global reference time now means that thepulse_indexwill depend on when we began to record the data (at the start of a frame period, or half way through it).We choose a few random events, compute the time-of-flight for every possible value
of
pulse_stride_offset, and return the value that yields the least number of NaNsin the computed time-of-flight.
We leave the option to specify the
PulseStrideOffsetas a parameter, and the guess is only performed if it is not provided.This is a workaround for #184 . It should be easy enough to swap it out later for a solution that reads the chopper logs.