-
Notifications
You must be signed in to change notification settings - Fork 1
fix: change coordinate system consistently #277
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
| open=ch.slit_begin, | ||
| close=ch.slit_end, | ||
| phase=abs(ch.phase), | ||
| phase=ch.phase if ch.frequency.value > 0.0 else -ch.phase, |
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.
If you change the order of operations in tof, does this go away?
(first add phase, and then mirror)
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.
No I could not make it go away by changing anything in tof.
I lean towards the implementation in tof being correct.
| phase=abs(ch.phase), | ||
| phase=ch.phase if ch.frequency.value > 0.0 else -ch.phase, | ||
| distance=sc.norm(ch.axle_position - source_position), | ||
| name=name, |
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.
Maybe we should add properly maintained methods in tof to construct chopper from DiskChopper and NeXus.
I suspect this code exists in multiple places (packages, notebooks etc...)
See scipp/tof#6.
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.
Yeah that sounds like a good idea. Do you want to see that in this PR?
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.
Do you want to see that in this PR?
No, I will do that separately.
Fixes #263
If the frequency is negative we change the direction of the coordinate system to make it positive.
In that case, phase should also be transformed the same way, but phase should not be transformed just because it is negative.