-
Notifications
You must be signed in to change notification settings - Fork 1
Handle time-dependent transformations for monitors #290
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
src/ess/reduce/nexus/workflow.py
Outdated
| 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), |
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.
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.
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.
Well, maybe it is equivalent in practice, given that T is almost always a plain translation?
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 I wasn't sure how to combine the offset with the transform.
I will go with T*(0,0,0)+offset 👍
Required to work around scipp/essreduce#290
Required to work around scipp/essreduce#290
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_monitorfunction.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