Skip to content

Essreduce + Essimaging + Essnmx: tofectomy#65

Merged
nvaytet merged 40 commits intomainfrom
essreduce-tofectomy
Mar 18, 2026
Merged

Essreduce + Essimaging + Essnmx: tofectomy#65
nvaytet merged 40 commits intomainfrom
essreduce-tofectomy

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Feb 25, 2026

Replacing time-of-flight with wavelength in the GenericTofWorkflow, which is now called GenericUnwrapWorkflow.

Note: once this is merged, every package using the GenericTofWorkflow not in the monorepo will break...

@nvaytet nvaytet added the essreduce Issues for essreduce. label Feb 25, 2026
@nvaytet nvaytet changed the title Essreduce: tofectomy Essreduce + Essimaging: tofectomy Mar 9, 2026
@nvaytet nvaytet marked this pull request as ready for review March 10, 2026 07:15
@nvaytet nvaytet marked this pull request as draft March 12, 2026 16:28
)


class WavelengthInterpolator:
Copy link
Contributor

@jokasimr jokasimr Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer that we keep the WavelengthInterpolator but when calling the InterpolatorImpl we pass lookup.data.values * self._distance_edges and in WavelengthInterpolator.__call__ we return
values=self._interpolator(...) / ltotal (but making that operation in-place is probably better).

Then I don't think we have to make other changes elsewhere or re-introduce tof, right?

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, I thought about it some more, and basically did just what you suggest here.

@nvaytet nvaytet requested a review from YooSunYoung March 13, 2026 14:31
@nvaytet
Copy link
Member Author

nvaytet commented Mar 13, 2026

@YooSunYoung can you take a look to make sure I didn't mess up anything in essnmx?

@nvaytet nvaytet marked this pull request as ready for review March 13, 2026 14:34
@nvaytet nvaytet added essimaging Issues for essimaging. essnmx Issues for essnmx. labels Mar 16, 2026
@nvaytet nvaytet changed the title Essreduce + Essimaging: tofectomy Essreduce + Essimaging + Essnmx: tofectomy Mar 16, 2026
@nvaytet
Copy link
Member Author

nvaytet commented Mar 17, 2026

A final thought (in the context of breaking changes):

Do we want to make it compatible with old lookup tables that stored tof instead of wavelength?
Basically load the table, look at the units. If they are time units, convert to wavelength on the fly?
Meaning that we don't necessarily need to update all lookup tables in our databases?

But it may make things confusing that the files are still called something with tof_lookup_table?

)


def test_compute_toa():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We leave this out for now. Time of arrival should instead be computed from event_time_zero and event_time_offset (see scipp/scippneutron#685)

@@ -570,109 +601,13 @@ def monitor_time_of_flight_data(
)


def detector_time_of_arrival_data(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be computed from event_time_zero + event_time_offset using Scippneutron instead: scipp/scippneutron#685

This was computing some strange unwrapped arrival time offset, but it cannot be used to trace back what the time was at sample. The name is confusing, so we remove it for now (it wasn't used by anything so far).

@YooSunYoung
Copy link
Member

It seems fine with NMX...!

@jokasimr
Copy link
Contributor

A final thought (in the context of breaking changes):
Do we want to make it compatible with old lookup tables that stored tof instead of wavelength?
Basically load the table, look at the units. If they are time units, convert to wavelength on the fly?
Meaning that we don't necessarily need to update all lookup tables in our databases?

It would be nicer to have a clean break without adding the complexity of having a fallback for old tables, if we can get away with it, and I think we can.
Old tables can still be used by not upgrading the packages to the latest version.

@nvaytet nvaytet merged commit 5b7a3b4 into main Mar 18, 2026
8 checks passed
@nvaytet nvaytet deleted the essreduce-tofectomy branch March 18, 2026 14:19
@github-project-automation github-project-automation bot moved this from Selected to Done in Development Board Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essimaging Issues for essimaging. essnmx Issues for essnmx. essreduce Issues for essreduce.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants