diff --git a/scripts/Diffraction/isis_powder/abstract_inst.py b/scripts/Diffraction/isis_powder/abstract_inst.py index c6a2da4f4e928af6c3c73d5efcaf9ef591fefbfb..380fe71341b27bb4ed5d255dd02bcd7481d2f54d 100644 --- a/scripts/Diffraction/isis_powder/abstract_inst.py +++ b/scripts/Diffraction/isis_powder/abstract_inst.py @@ -123,15 +123,6 @@ class AbstractInst(object): """ return input_workspace - def apply_solid_angle_efficiency_corr(self, ws_to_correct, run_details): - """ - Applies solid angle corrections calculating them if necessary for the workspace - :param ws_to_correct: The workspace to apply the solid angle corrections to - :param run_details: The run details for the associated run to allow for loading and saving - :return: The corrected workspace - """ - return ws_to_correct - @staticmethod def can_auto_gen_vanadium_cal(): """ diff --git a/scripts/Diffraction/isis_powder/polaris.py b/scripts/Diffraction/isis_powder/polaris.py index 575b9026988a6818f9469730285b20c9ee1047ff..b036cb080cccfdac07ebfb9fda8ef599e5de341e 100644 --- a/scripts/Diffraction/isis_powder/polaris.py +++ b/scripts/Diffraction/isis_powder/polaris.py @@ -75,17 +75,6 @@ class Polaris(AbstractInst): normalised_ws = mantid.NormaliseByCurrent(InputWorkspace=ws_to_correct, OutputWorkspace=ws_to_correct) return normalised_ws - def apply_solid_angle_efficiency_corr(self, ws_to_correct, run_details): - if not self._inst_settings.solid_angle_on: - return ws_to_correct - - corrections = polaris_algs.generate_solid_angle_corrections(run_details=run_details, instrument=self) - corrected_ws = mantid.Divide(LHSWorkspace=ws_to_correct, RHSWorkspace=corrections) - common.remove_intermediate_workspace(corrections) - common.remove_intermediate_workspace(ws_to_correct) - ws_to_correct = corrected_ws - return ws_to_correct - def spline_vanadium_ws(self, focused_vanadium_spectra, instrument_version=''): masking_file_name = self._inst_settings.masking_file_name spline_coeff = self._inst_settings.spline_coeff diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py index a61b999c0649cc1f1d1ab9b1e0a2528e0ee9087e..aa28de1003f3e02e14b67cacab73c94fbab33098 100644 --- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py +++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py @@ -3,7 +3,6 @@ file_names = { } script_params = { - "apply_solid_angle": False, "raw_data_cropping_values": (750, 20000), "spline_coefficient": 100, "vanadium_cropping_values": (800, 19995) @@ -46,9 +45,6 @@ variable_help = { }, "script_params": { - "apply_solid_angle": "Specifies if the script should perform solid angle corrections. This is usually " - "defaulted to off and should be overridden in the basic configuration when necessary to " - "avoid them being performed accidentally.", "raw_data_cropping_values": "This specifies the valid range in TOF of the raw data. This is applied before any " "processing takes place to remove negative counts at very low TOF values", "spline_coefficient": "The coefficient to use when calculating the vanadium splines during the calibration " diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py index 418e9f3083c3c05bdc118398077b582344af76c9..e6047fec305b8aafc4a2c762494ca07c11c94713 100644 --- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py +++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py @@ -28,15 +28,6 @@ def calculate_absorb_corrections(ws_to_correct): return ws_to_correct -def generate_solid_angle_corrections(run_details, instrument): - vanadium_ws = common.load_current_normalised_ws_list(run_number_string=run_details.vanadium_run_numbers, - instrument=instrument, input_batching=InputBatchingEnum.Summed) - corrections = _calculate_solid_angle_efficiency_corrections(vanadium_ws[0]) - mantid.SaveNexusProcessed(InputWorkspace=corrections, Filename=run_details.solid_angle_corr) - common.remove_intermediate_workspace(vanadium_ws) - return corrections - - def get_run_details(run_number, inst_settings): yaml_dict = yaml_parser.get_run_dictionary(run_number=run_number, file_path=inst_settings.cal_mapping_file) @@ -49,16 +40,12 @@ def get_run_details(run_number, inst_settings): empty_runs = chopper_config["empty_run_numbers"] vanadium_runs = chopper_config["vanadium_run_numbers"] - solid_angle_file_name = _generate_solid_angle_file_name(chopper_on=inst_settings.chopper_on, - vanadium_run_string=vanadium_runs) splined_vanadium_name = _generate_splined_van_name(chopper_on=inst_settings.chopper_on, - sac_applied=inst_settings.solid_angle_on, vanadium_run_string=vanadium_runs) in_calib_dir = os.path.join(inst_settings.calibration_dir, label) calibration_full_path = os.path.join(in_calib_dir, yaml_dict["offset_file_name"]) grouping_full_path = os.path.join(in_calib_dir, yaml_dict["offset_file_name"]) - solid_angle_file_path = os.path.join(in_calib_dir, solid_angle_file_name) splined_vanadium = os.path.join(in_calib_dir, splined_vanadium_name) run_details = RunDetails(run_number=run_number) @@ -69,7 +56,6 @@ def get_run_details(run_number, inst_settings): run_details.calibration_file_path = calibration_full_path run_details.grouping_file_path = grouping_full_path run_details.splined_vanadium_file_path = splined_vanadium - run_details.solid_angle_corr = solid_angle_file_path return run_details @@ -126,45 +112,13 @@ def _apply_bragg_peaks_masking(workspaces_to_mask, mask_list): return output_workspaces -def _calculate_solid_angle_efficiency_corrections(vanadium_ws): - solid_angle_ws = mantid.SolidAngle(InputWorkspace=vanadium_ws) - solid_angle_multiplicand = mantid.CreateSingleValuedWorkspace(DataValue=str(100)) - solid_angle_ws = mantid.Multiply(LHSWorkspace=solid_angle_ws, RHSWorkspace=solid_angle_multiplicand) - common.remove_intermediate_workspace(solid_angle_multiplicand) - - efficiency_ws = mantid.Divide(LHSWorkspace=vanadium_ws, RHSWorkspace=solid_angle_ws) - efficiency_ws = mantid.ConvertUnits(InputWorkspace=efficiency_ws, Target="Wavelength") - efficiency_ws = mantid.Integration(InputWorkspace=efficiency_ws) - - corrections_ws = mantid.Multiply(LHSWorkspace=solid_angle_ws, RHSWorkspace=efficiency_ws) - corrections_divisor_ws = mantid.CreateSingleValuedWorkspace(DataValue=str(100000)) - corrections_ws = mantid.Divide(LHSWorkspace=corrections_ws, RHSWorkspace=corrections_divisor_ws) - - common.remove_intermediate_workspace(corrections_divisor_ws) - common.remove_intermediate_workspace(solid_angle_ws) - common.remove_intermediate_workspace(efficiency_ws) - - return corrections_ws - - -def _generate_solid_angle_file_name(chopper_on, vanadium_run_string): - if chopper_on: - return "SAC_" + vanadium_run_string + "_chopperOn" - else: - return "SAC_" + vanadium_run_string + "_chopperOff" - - -def _generate_splined_van_name(chopper_on, sac_applied, vanadium_run_string): +def _generate_splined_van_name(chopper_on, vanadium_run_string): output_string = "SVan_" + str(vanadium_run_string) + "_chopper" if chopper_on: output_string += "On" else: output_string += "Off" - if sac_applied: - output_string += "_SAC" - else: - output_string += "_noSAC" return output_string diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py index 7f14c85b42be9bfed62c927a4dc10ac15b6453d4..cf5ece39fcafe524eb4ed153d2838f30722138c1 100644 --- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py +++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py @@ -1,8 +1,7 @@ from __future__ import (absolute_import, division, print_function) # Maps friendly user name -> script name -attr_mapping = [("apply_solid_angle", "solid_angle_on"), - ("calibration_directory", "calibration_dir"), +attr_mapping = [("calibration_directory", "calibration_dir"), ("calibration_mapping_file", "cal_mapping_file"), ("chopper_on", "chopper_on"), ("config_file", "config_file"), diff --git a/scripts/Diffraction/isis_powder/routines/calibrate.py b/scripts/Diffraction/isis_powder/routines/calibrate.py index 897060c64404efeb089c1c9fc74e80557c1f3395..cb74664b5331d190a2d6d2481176976baa642f74 100644 --- a/scripts/Diffraction/isis_powder/routines/calibrate.py +++ b/scripts/Diffraction/isis_powder/routines/calibrate.py @@ -21,9 +21,6 @@ def create_van(instrument, van, empty, absorb, gen_absorb): corrected_van_ws = mantid.AlignDetectors(InputWorkspace=corrected_van_ws, CalibrationFile=run_details.calibration_file_path) - corrected_van_ws = instrument.apply_solid_angle_efficiency_corr(ws_to_correct=corrected_van_ws, - run_details=run_details) - if absorb: corrected_van_ws = _apply_absorb_corrections(instrument=instrument, run_details=run_details, corrected_van_ws=corrected_van_ws, gen_absorb=gen_absorb) diff --git a/scripts/Diffraction/isis_powder/routines/focus.py b/scripts/Diffraction/isis_powder/routines/focus.py index 33fa533f5eaf3c2279167f10a206bb693dfe5288..f54bbb1592f5c6323d7609a110bd55971625f435 100644 --- a/scripts/Diffraction/isis_powder/routines/focus.py +++ b/scripts/Diffraction/isis_powder/routines/focus.py @@ -30,9 +30,6 @@ def _focus_one_ws(ws, run_number, instrument, perform_vanadium_norm): input_workspace = mantid.AlignDetectors(InputWorkspace=input_workspace, CalibrationFile=run_details.calibration_file_path) - input_workspace = instrument.apply_solid_angle_efficiency_corr(ws_to_correct=input_workspace, - run_details=run_details) - focused_ws = mantid.DiffractionFocussing(InputWorkspace=input_workspace, GroupingFileName=run_details.grouping_file_path)