Ticket #4550 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

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

Screenshot-ConvertToMDEvents input dialog.png (72.2 KB) - added by Stuart Campbell 9 years ago.
Screenshot-Slice Viewer-full-q-range.png (65.1 KB) - added by Stuart Campbell 9 years ago.
Screenshot-Slice Viewer-reduced-q-range.png (66.7 KB) - added by Stuart Campbell 9 years ago.

Change History

Changed 9 years ago by Stuart Campbell

Changed 9 years ago by Stuart Campbell

Changed 9 years ago by Stuart Campbell

comment:1 Changed 9 years ago by Alex Buts

  • Status changed from new to assigned

comment:2 Changed 9 years ago by Alex Buts

  • Status changed from assigned to accepted

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

comment:8 Changed 9 years ago by Stuart Campbell

  • Status changed from verifying to closed

Looks good.

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5397

Note: See TracTickets for help on using tickets.