Ticket #5318 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

ConvertToMDEvents does not keep track of 0s

Reported by: Andrei Savici Owned by: Alex Buts
Priority: blocker Milestone: Release 2.2
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Andrei Savici

Description

Try

Load(Filename='CNCS_7860_event.nxs',OutputWorkspace='CNCS_7860_event')
ConvertUnits(InputWorkspace='CNCS_7860_event',OutputWorkspace='CNCS_7860_event',Target='DeltaE',EMode='Direct',EFixed='3')
Rebin(InputWorkspace='CNCS_7860_event',OutputWorkspace='CNCS_7860_event',Params='-3,0.1,3',PreserveEvents='0')
SetGoniometer(Workspace='CNCS_7860_event',Axis0='huber,0,1,0,1')
SetUB(Workspace='CNCS_7860_event',a='2',b='3',c='4')
ConvertToMDEvents(InputWorkspace='CNCS_7860_event',OutputWorkspace='md',QDimensions='Q3D',QConversionScales='HKL',MinValues='-3,-3,-3,-3',MaxValues='3,3,3,3')

There should be 51200*60 MDEvents, but I see only 57715. I saved the MD workspace to a NeXus file, and I do not see events with weight 0.

Change History

comment:1 Changed 8 years ago by Alex Buts

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Alex Buts

there is condition in the convertToMDEvents which drops empty events. I have reviseted the code and see no reason why it is there.

ignoreNaN should be there instead.

comment:3 Changed 8 years ago by Andrei Savici

The problem is that you drop so called "empty events" in line 131 of ConvertToMDEventsHistoWS.h Of course, that is physically wrong. If you measure something and you obtain that it is 0, you should keep it. Also, your code would get rid of events coming from bins with negative weights. You need to keep those as well (some people subtract background)

Note that there is a system test that will fail when you fix this algorithm

comment:4 Changed 8 years ago by Alex Buts

refs #5318 This should fix it

Changeset: c77edbf0c53ef996de0f948e03b36718d1801ddc

comment:5 Changed 8 years ago by Alex Buts

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:6 Changed 8 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:7 Changed 8 years ago by Alex Buts

the problem has been fixed for old ConvertToMDEvents Code but also should be fixed (not appear in) new ConvertToMD code

comment:8 Changed 8 years ago by Andrei Savici

  • Status changed from verifying to closed

Works in the new code

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6164

Note: See TracTickets for help on using tickets.