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

Re #17949 Move output name in van calib to optional param

parent 30bc7d59
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,9 @@ def _run_vanadium_calibration():
gen_absorb = True
polaris_obj = setup_polaris_instrument()
# Try it without an output name
polaris_obj.create_calibration_vanadium(vanadium_runs=vanadium_run, empty_runs=empty_run,
gen_absorb_correction=gen_absorb)
return polaris_obj.create_calibration_vanadium(vanadium_runs=vanadium_run, empty_runs=empty_run,
output_file_name=output_file_name, gen_absorb_correction=gen_absorb)
......
......@@ -82,7 +82,7 @@ class AbstractInst(object):
self._create_calibration_silicon(calibration_runs=calibration_runs, cal_file_name=cal_file_name,
grouping_file_name=grouping_file_name)
def create_calibration_vanadium(self, vanadium_runs, empty_runs, output_file_name, num_of_splines=None,
def create_calibration_vanadium(self, vanadium_runs, empty_runs, output_file_name=None, num_of_splines=None,
do_absorb_corrections=True, gen_absorb_correction=False):
calibrate.create_van(instrument=self, van=vanadium_runs, empty=empty_runs,
output_van_file_name=output_file_name, num_of_splines=num_of_splines,
......
......@@ -17,8 +17,6 @@ def create_van(instrument, van, empty, output_van_file_name, num_of_splines, abs
calibration_full_paths = instrument._get_calibration_full_paths(run_number=van)
# Absorb was here
corrected_van_ws = instrument. _apply_van_calibration_tof_rebinning(vanadium_ws=corrected_van_ws,
tof_rebin_pass=1, return_units="TOF")
......@@ -47,8 +45,14 @@ def create_van(instrument, van, empty, output_van_file_name, num_of_splines, abs
if instrument._PEARL_filename_is_full_path():
out_van_file_path = output_van_file_name
else:
elif output_van_file_name:
# The user has manually specified the output file name
out_van_file_path = os.path.join(instrument.calibration_dir, output_van_file_name)
else:
try:
out_van_file_path = calibration_full_paths["calibrated_vanadium"]
except KeyError:
raise ValueError("The output name must be manually specified for this instrument/run")
append = False
for ws in splined_ws_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