Skip to content
Snippets Groups Projects
Commit 964e04bd authored by David Fairbrother's avatar David Fairbrother
Browse files

Re #18666 Reduce number of leftover ws from algorithm

parent b8324491
No related branches found
No related tags found
No related merge requests found
......@@ -18,14 +18,14 @@ def create_van(instrument, van, empty, absorb, gen_absorb):
# Crop the tail end of the data on PEARL if they are not capturing slow neutrons
corrected_van_ws = instrument._crop_raw_to_expected_tof_range(ws_to_crop=corrected_van_ws)
corrected_van_ws = mantid.AlignDetectors(InputWorkspace=corrected_van_ws,
aligned_ws = mantid.AlignDetectors(InputWorkspace=corrected_van_ws,
CalibrationFile=run_details.calibration_file_path)
if absorb:
corrected_van_ws = _apply_absorb_corrections(instrument=instrument, run_details=run_details,
corrected_van_ws=corrected_van_ws, gen_absorb=gen_absorb)
aligned_ws = _apply_absorb_corrections(instrument=instrument, run_details=run_details,
van_ws=aligned_ws, gen_absorb=gen_absorb)
focused_vanadium = mantid.DiffractionFocussing(InputWorkspace=corrected_van_ws,
focused_vanadium = mantid.DiffractionFocussing(InputWorkspace=aligned_ws,
GroupingFileName=run_details.grouping_file_path)
focused_spectra = common.extract_ws_spectra(focused_vanadium)
......@@ -37,6 +37,7 @@ def create_van(instrument, van, empty, absorb, gen_absorb):
_create_vanadium_splines(focused_spectra, instrument, run_details)
common.remove_intermediate_workspace(corrected_van_ws)
common.remove_intermediate_workspace(aligned_ws)
common.remove_intermediate_workspace(focused_vanadium)
common.remove_intermediate_workspace(focused_spectra)
......@@ -53,8 +54,8 @@ def _create_vanadium_splines(focused_spectra, instrument, run_details):
mantid.GroupWorkspaces(InputWorkspaces=splined_ws_list, OutputWorkspace="Van_spline_data")
def _apply_absorb_corrections(instrument, run_details, corrected_van_ws, gen_absorb):
absorb_ws = instrument._apply_absorb_corrections(run_details, corrected_van_ws, gen_absorb=gen_absorb)
def _apply_absorb_corrections(instrument, run_details, van_ws, gen_absorb):
absorb_ws = instrument._apply_absorb_corrections(run_details, van_ws, gen_absorb=gen_absorb)
return absorb_ws
......
......@@ -81,6 +81,7 @@ def _divide_by_vanadium_splines(spectra_list, spline_file_path):
vanadium_ws = mantid.RebinToWorkspace(WorkspaceToRebin=van_ws, WorkspaceToMatch=data_ws)
output_ws = mantid.Divide(LHSWorkspace=data_ws, RHSWorkspace=vanadium_ws, OutputWorkspace=data_ws)
output_list.append(output_ws)
common.remove_intermediate_workspace(vanadium_ws)
return output_list
......
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