Commit 5592ac05 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge pull request #15717 from mantidproject/autoredux_cache_binning

Rebin background to data when using cache file
parents 82567ea5 399168c6
......@@ -383,14 +383,16 @@ class SNSPowderReduction(DataProcessorAlgorithm):
# the final bit of math to remove container run and vanadium run
if can_run_ws_name is not None:
can_run_ws = self.get_workspace(can_run_ws_name)
# must convert the sample to a matrix workspace if the can run isn't one
if allEventWorkspaces(can_run_ws, sam_ws_name):
if allEventWorkspaces(can_run_ws_name, sam_ws_name):
sam_ws = api.ConvertToMatrixWorkspace(InputWorkspace=sam_ws_name,
OutputWorkspace=sam_ws_name)
assert sam_ws is not None
# remove container run
api.RebinToWorkspace(WorkspaceToRebin=can_run_ws_name,
WorkspaceToMatch=sam_ws_name,
OutputWorkspace=can_run_ws_name)
sam_ws = api.Minus(LHSWorkspace=sam_ws_name,
RHSWorkspace=can_run_ws_name,
OutputWorkspace=sam_ws_name)
......@@ -753,7 +755,7 @@ class SNSPowderReduction(DataProcessorAlgorithm):
self.checkInfoMatch(info, tempinfo)
# add current workspace to sub sum
temp_ws = api.Plus(LHSWorkspace=sumRun, RHSWorkspace=out_ws_name, OutputWorkspace=sumRun,
ClearRHSWorkspace=allEventWorkspaces(sumRun, out_ws_name))
ClearRHSWorkspace=allEventWorkspaces(sumRun, out_ws_name))
if temp_ws.id() == EVENT_WORKSPACE_ID:
temp_ws = api.CompressEvents(InputWorkspace=sumRun, OutputWorkspace=sumRun,
Tolerance=self.COMPRESS_TOL_TOF) # 10ns
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment