Skip to content
Snippets Groups Projects
Commit 205df3aa authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #23579 possible fix for Pearl tests

parent 7279db4e
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,19 @@ def apply_vanadium_absorb_corrections(van_ws, run_details, absorb_ws=None):
if van_original_units != absorb_units:
van_ws = mantid.ConvertUnits(InputWorkspace=van_ws, Target=absorb_units, OutputWorkspace=van_ws)
van_ws = mantid.RebinToWorkspace(WorkspaceToRebin=van_ws, WorkspaceToMatch=absorb_ws, OutputWorkspace=van_ws)
# ensure uniform binning across spectra
# extract the binning parameters from the first spectrum.
# there is probably a better way to calculate the binning parameters, but this
# gets the right answer.
xaxis = absorb_ws.readX(0)
params = []
for i, x in enumerate(xaxis):
params.append(x)
if i < len(xaxis) - 1:
params.append(xaxis[i + 1] - x) # delta
van_ws = mantid.Rebin(InputWorkspace=van_ws, Params=params)
#van_ws = mantid.RebinToWorkspace(WorkspaceToRebin=van_ws, WorkspaceToMatch=absorb_ws, OutputWorkspace=van_ws)
van_ws = mantid.Divide(LHSWorkspace=van_ws, RHSWorkspace=absorb_ws, OutputWorkspace=van_ws)
if van_original_units != absorb_units:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment