Ticket #7323 (closed: fixed)
Expose more of ReferenceFrame to Python
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | major | Milestone: | Release 2.6 |
Component: | Python | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Martyn Gigg |
Description (last modified by Nick Draper) (diff)
Looks like one of the areas of inflexibility that the reflectometry group at ISIS suffer is that the instrument definitions are set up with different reference frames. For example, INTER has z as the beam direction, and y as the up direction, while POLREF has x as the bam direction and z as the up direction. This means that scripts like this https://github.com/mantidproject/mantid/blob/master/Code/Mantid/scripts/Reflectometry/isis_reflgui/l2q.py (created by our users) have to be written on an instrument by instrument basis to be correct. Because the offset calculation requires knowledge of the instrument reference frame to be correct.
I'd like to point them to a feature I have already exposed in python that will solve this issue for them, and that's the ReferenceFrame. However, It would be better to expose more useful features of this utility before drawing their attention to it.
Change History
comment:2 Changed 7 years ago by Owen Arnold
Tester: Once done, the following should give sensible answers in both the old and new API. You should compare the results given to the reference frame entry in the IDF, and check that this works in both the old and new API.
ws = Load(Filename="POLREF00004699.nxs") ws = ws[0] inst=ws.getInstrument() ref = inst.getReferenceFrame() print ref.pointingAlongBeam() print ref.vecPointingAlongBeam() print ref.pointingUp() print ref.vecPointingUp()
Here it is in the old API
from mantidsimple import * Load(Filename="POLREF00004699.nxs", OutputWorkspace='ws') ws = mtd['ws'] ws = ws[0] inst=ws.getInstrument() ref = inst.getReferenceFrame() print ref.pointingAlongBeam() print ref.vecPointingAlongBeam() print ref.pointingUp() print ref.vecPointingUp()
comment:3 Changed 7 years ago by Owen Arnold
refs #7323. Expose reference frame aspects to python.
Changeset: 003fc784e165defe16b0b1d7a8e5bd0f139828d6
comment:4 Changed 7 years ago by Owen Arnold
- Status changed from accepted to verify
- Resolution set to fixed
Branch is feature/7323_reference_frame. Follow test instructions above.
comment:5 Changed 7 years ago by Martyn Gigg
- Status changed from verify to verifying
- Tester set to Martyn Gigg
comment:6 Changed 7 years ago by Owen Arnold
refs #7323. Expose reference frame aspects to python.
Changeset: 449675361960a781f05294c1380d5a83bd3f37fe
comment:7 Changed 7 years ago by Martyn Gigg
- Status changed from verifying to closed
Code is fine & tests do what they are expected to do.
comment:9 Changed 7 years ago by Nick Draper
- Component changed from Framework to Python API
- Description modified (diff)
comment:10 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 8169