Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Dec 3, 2025

The loki monitor 4 has a time-dependent transform which we did not handle.
The transform is correctly handled for detectors, but not monitors.
This PR fixes this.

I checked that this did not change the positions of the other monitors (i.e. non time-dependent transforms should still work as before and give the same result), but this does change the API of the get_calibrated_monitor function.
I don't know if this gets imported and used directly outside of the GenericNeXusWorkflow...

This would fix https://git.esss.dk/dmsc-nightly/dmsc-nightly/-/issues/52

@nvaytet nvaytet requested a review from SimonHeybrock December 3, 2025 15:14
return EmptyMonitor[RunType, MonitorType](
nexus.extract_signal_data_array(monitor).assign_coords(
position=monitor['position'] + offset.to(unit=monitor['position'].unit),
position=transform.value * offset.to(unit=transform.value.unit),
Copy link
Member

Choose a reason for hiding this comment

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

This does not look right, comparing to the detector: The offset is a naive offset that we first introduced to handle ISIS SANS. It is applied as raw offset to the positions. Note the difference between offsets (the pixel offsets) and offset in detector provider above. Here the equivalent to offsets would be (0,0,0), so we should have T*(0,0,0)+offset, I think.

Copy link
Member

Choose a reason for hiding this comment

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

Well, maybe it is equivalent in practice, given that T is almost always a plain translation?

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 wasn't sure how to combine the offset with the transform.
I will go with T*(0,0,0)+offset 👍

@nvaytet nvaytet merged commit a5ee900 into main Dec 4, 2025
4 checks passed
@nvaytet nvaytet deleted the monitor-time-dependent-transform branch December 4, 2025 10:50
jl-wynen added a commit to scipp/essdiffraction that referenced this pull request Dec 5, 2025
jl-wynen added a commit to scipp/esssans that referenced this pull request Dec 8, 2025
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