Ticket #3382 (closed: fixed)
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: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.