Ticket #4550 (closed: fixed)
Incorrect representation after ConvertToMDEvents for reduced Q range.
Reported by: | Stuart Campbell | Owned by: | Alex Buts |
---|---|---|---|
Priority: | blocker | Milestone: | Release 2.0 |
Component: | Mantid | Keywords: | |
Cc: | 8oz@…, saviciat@… | Blocked By: | |
Blocking: | Tester: | Stuart Campbell |
Description
If you run convertToMDEvents for an inelastic dataset for a Q-range that is smaller than the maximum Q value in the dataset then you get a strange display. Basically the higher Q values are wrapped around and mapped onto low Q bins/boxes.
Procedure used:
- Load CNCS_7860_event.nxs from AutoTestData directory.
- AddSampleLog to add Ei of 3.0 (Number) to workspace.
- ConvertToMDEvents (see screenshot for parameters)
For the second case I just changed the first number for MaxValues to 4.
Attachments
Change History
Changed 9 years ago by Stuart Campbell
- Attachment Screenshot-ConvertToMDEvents input dialog.png added
Changed 9 years ago by Stuart Campbell
- Attachment Screenshot-Slice Viewer-reduced-q-range.png added
comment:3 Changed 9 years ago by Stuart Campbell
One thing to note, that if I run binMD on the workspace that looks wrong (0<Q<2.0), then it looks correct again. So I don't know if the problem is with the box structure of the MDEventWorkspace.
comment:4 Changed 9 years ago by Janik Zikovsky
My guess at what is going on:
- If you use addEvent() to add a single event to the parent IMDBox, there is NO bounds checking. This is for performance. So the events on the right side of the plot end up mis-placed in the left as they overflow the X dimension.
- The answer is to use the addEvents() method on IMDBox, which does do bounds checking. Or to do your own bounds checking before if you prefer.
comment:5 Changed 9 years ago by Alex Buts
refs #4550 Stupid error in conversion fixed
Changeset: 1cfe1a849f4e37a474ada1e52ef23108aefb2d19
comment:6 Changed 9 years ago by Alex Buts
- Status changed from accepted to verify
- Resolution set to fixed
That was really stupid error in the code during bound checking in this place. Accordingly, difficult to spot.
Hope it has gone now.
comment:7 Changed 9 years ago by Stuart Campbell
- Status changed from verify to verifying
- Tester set to Stuart Campbell