Ticket #3382 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Many algorithms are using MatrixWorspace::maskBins() wrongly

Reported by: Steve Williams Owned by: Steve Williams
Priority: major Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Anders Markvardsen

Description

MatrixWorspace::maskBins() should probably only be called by the MaskBins algorithm. Algorithms that only propagate masking (CropWorkspace, Rebin, BinaryOperation, ...) should only propagate masking using the flagMasked() method. This was causing a problem with partially masked bins (the y-values were being scaled many times and so reduced each time bin masking was propagated), fully masked bins were OK.

Below is a test case that wasn't working.

Load(Filename='LOQ54431',OutputWorkspace='LOQ54431')
MaskBins(InputWorkspace='LOQ54431',OutputWorkspace='mask1',XMin='19000',XMax='20000')
#creates the partially masked bins that we will check
Rebin(InputWorkspace='mask1',OutputWorkspace='mask1',Params='18000,100,22000',PreserveEvents='0')
#handles the masked bin wrongly at the same time as cropping down the data
CropWorkspace(InputWorkspace='mask1',OutputWorkspace='mask1',XMin='18000',XMax='22000',StartWorkspaceIndex='1',EndWorkspaceIndex='1')
CropWorkspace(InputWorkspace='mask1',OutputWorkspace='mask_many',XMin='18000',XMax='22000')
for i in range(0,5):
	CropWorkspace(InputWorkspace='mask_many',OutputWorkspace='mask_many',XMin='10000',XMax='30000')
CheckWorkspacesMatch('mask1', 'mask_many')

Change History

comment:1 Changed 9 years ago by Steve Williams

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Steve Williams

In [13294]:

Tests for the new propagate masks method flagMask() re #3382

comment:3 Changed 9 years ago by Steve Williams

In [13309]:

When masked _bins_ are propagated from an input to an output workspace the y-values shouldn't be modified re #3382

comment:4 Changed 9 years ago by Steve Williams

Cropworkspace was not the only algorithm with a problem, run the test in the description on any algorithm that contains maskBin() and you'll see the problem, flagBin() should be OK.

comment:5 Changed 9 years ago by Steve Williams

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

Check that the above Python script with the CropWorkspace inside the loop replaced with any of th ealgorithms I changed and workspaces still match.

comment:6 Changed 9 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:7 Changed 9 years ago by Anders Markvardsen

  • Status changed from verifying to closed

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4229

Note: See TracTickets for help on using tickets.