Skip to content

Commit

Permalink
Refs #5162. Will use grouping file from parameter file.
Browse files Browse the repository at this point in the history
It will now check for a 'File' grouping method and if set
it will then read the Workflow.GroupingFile parameter and
set this to be the grouping_policy
  • Loading branch information
stuartcampbell committed Apr 26, 2012
1 parent 9dddd87 commit b6dd745
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ def execute(self, reducer, file_ws):
group = 'User'
if ( group == 'Fixed' ):
self._result_workspaces.append(self._group_fixed(ws))
elif (group == 'File' ):
self._grouping_policy = mtd[ws].getInstrument().getStringParameter(
'Workflow.GroupingFile')[0]
self._result_workspaces.append(self._group_data(ws))
else:
self._result_workspaces.append(self._group_data(ws))

Expand Down Expand Up @@ -823,8 +827,17 @@ def _group_data(self, workspace):
GroupDetectors(workspace, workspace,
WorkspaceIndexList=wslist, Behaviour='Average')
else:
GroupDetectors(workspace, workspace, MapFile=grouping,
Behaviour='Average')
# Assume we have a grouping file.
# First lets, find the file...
if (os.path.isfile(grouping)):
grouping_filename = grouping
else:
grouping_filename = os.path.join(mtd.getConfigProperty('groupingFiles.directory'),
grouping)
# Final check that the Mapfile exists, if not don't run the alg.
if os.path.isfile(grouping_filename):
GroupDetectors(workspace, workspace, MapFile=grouping_filename,
Behaviour='Average')
return workspace

class SaveItem(ReductionStep):
Expand Down

0 comments on commit b6dd745

Please sign in to comment.