Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Nov 10, 2025

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 toa coord.
It is not computed as part of the normal tof workflow, only computed upon request.

Some code was refactored to avoid large duplications.

@nvaytet nvaytet marked this pull request as ready for review November 11, 2025 08:02
@nvaytet nvaytet requested a review from jl-wynen November 11, 2025 08:02
Comment on lines +500 to +501
if inputs["pulse_index"] is not None:
parts["data"] = parts["data"] + inputs["pulse_index"] * inputs["pulse_period"]
Copy link
Member

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?

Copy link
Member Author

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."""
Copy link
Member

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?

nvaytet and others added 2 commits November 11, 2025 16:03
Co-authored-by: Simon Heybrock <12912489+SimonHeybrock@users.noreply.github.com>
@nvaytet nvaytet merged commit b46edac into main Nov 12, 2025
4 checks passed
@nvaytet nvaytet deleted the toa-workflow branch November 12, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants