Skip to content

Commit

Permalink
Refs #9536 Fix passing mask list between reduction steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed May 29, 2014
1 parent f9def51 commit 0409529
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Expand Up @@ -10,6 +10,8 @@ def __init__(self):
super(MSGDiffractionReducer, self).__init__()

def _setup_steps(self):
self.append_step(steps.IdentifyBadDetectors(
MultipleFrames=self._multiple_frames))
self.append_step(steps.HandleMonitor(
MultipleFrames=self._multiple_frames))
self.append_step(steps.CorrectByMonitor(
Expand All @@ -34,7 +36,6 @@ def _setup_steps(self):
self.append_step(steps.RebinToFirstSpectrum())

step = steps.Grouping()
step.set_mask_list(self._masking_detectors)
step.set_grouping_policy("All")
self.append_step(step)

Expand Down
Expand Up @@ -95,7 +95,6 @@ def _setup_steps(self):

step = steps.Grouping(MultipleFrames=self._multiple_frames)
step.set_grouping_policy(self._grouping_policy)
step.set_mask_list(self._masking_detectors)
self.append_step(step)

# "FoldData" puts workspaces that have been chopped back together.
Expand Down
Expand Up @@ -264,8 +264,8 @@ def execute(self, reducer, file_ws):
self._masking_detectors.append(i)
DeleteWorkspace(Workspace=temp_ws_mask)

#set the detector masks on the workspace
reducer._masking_detectors = self._masking_detectors
#set the detector masks for the workspace
reducer._masking_detectors[file_ws] = self._masking_detectors

def get_mask_list(self):
return self._masking_detectors
Expand Down Expand Up @@ -910,13 +910,18 @@ def __init__(self, MultipleFrames=False):
self._multiple_frames = MultipleFrames

def execute(self, reducer, file_ws):

if ( self._multiple_frames ):
try:
workspaces = mtd[file_ws].getNames()
except AttributeError:
workspaces = [file_ws]
else:
workspaces = [file_ws]

# set the detector mask for this workspace
if file_ws in reducer._masking_detectors:
self._masking_detectors = reducer._masking_detectors[file_ws]

for ws in workspaces:
if self._grouping_policy is not None:
Expand All @@ -939,9 +944,6 @@ def execute(self, reducer, file_ws):
def set_grouping_policy(self, value):
self._grouping_policy = value

def set_mask_list(self, value):
self._masking_detectors = value

def get_result_workspaces(self):
return self._result_workspaces

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/Inelastic/msg_reducer.py
Expand Up @@ -20,7 +20,7 @@ class MSGReducer(reducer.Reducer):
_monitor_index = None #: Index of Monitor specturm.
_multiple_frames = False
_detector_range = [-1, -1]
_masking_detectors = []
_masking_detectors = {}
_parameter_file = None
_rebin_string = None
_fold_multiple_frames = True
Expand Down

0 comments on commit 0409529

Please sign in to comment.