-
Notifications
You must be signed in to change notification settings - Fork 1
Add provider to tof workflow to compute toa #276
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
| if inputs["pulse_index"] is not None: | ||
| parts["data"] = parts["data"] + inputs["pulse_index"] * inputs["pulse_period"] |
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.
When would it be None? What is the meaning of that case? No pulse-skipping?
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.
Yes, when there is no pulse-skipping, the pulse_index is None. It is this way to avoid allocating a large array of zeros (size Nevents) if it is not needed.
I added a comment to clarify.
|
|
||
|
|
||
| class ToaDetector(sl.Scope[RunType, sc.DataArray], sc.DataArray): | ||
| """Detector data with time-of-arrival coordinate.""" |
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.
Extend description to clarify difference with event_time_offset?
Co-authored-by: Simon Heybrock <12912489+SimonHeybrock@users.noreply.github.com>
Time-of-arrival is defined as
event_time_offset + pulse_index * pulse_period.It is useful if one wishes to histogram event data which uses pulse skipping, as it unwraps the data over the full frame period (instead of the pulse period that the event_time_offset gives).
We add a provider which computes the detector data with a
toacoord.It is not computed as part of the normal tof workflow, only computed upon request.
Some code was refactored to avoid large duplications.