diff --git a/scripts/Diffraction/isis_powder/abstract_inst.py b/scripts/Diffraction/isis_powder/abstract_inst.py index 43010082469de9a3ef56f544db10835a061ccf1f..9a01c16d0872c3d05a6a5f8588d4d088950a3272 100644 --- a/scripts/Diffraction/isis_powder/abstract_inst.py +++ b/scripts/Diffraction/isis_powder/abstract_inst.py @@ -100,14 +100,7 @@ class AbstractInst(object): extension = self.default_input_ext return os.path.join(input_dir, (file_name + extension)) - @abstractmethod - def get_default_group_names(self): - """ - Returns the default names for creating a blank calibration by names - @return: The default grouping names as a string - """ - - # Instrument specific methods + # Instrument specific properties @abstractmethod def get_run_details(self, run_number): @@ -116,75 +109,65 @@ class AbstractInst(object): @staticmethod @abstractmethod def generate_inst_file_name(run_number): - """ - Generates the conforming file names for an instrument - @param run_number: The run number to turn into a filename - @return: The filename of the file - Without the path or extension - """ + pass @abstractmethod def get_num_of_banks(self, instrument_version=''): pass # --- Instrument optional hooks ----# - # TODO cull some of these hooks once we unify the scripts - @staticmethod - def get_save_range(instrument_version): - return None + def apply_solid_angle_efficiency_corr(self, ws_to_correct, run_details): + return ws_to_correct def attenuate_workspace(self, input_workspace): return input_workspace - def normalise_ws(self, ws_to_correct, run_details=None): + def calculate_focus_binning_params(self, sample): + return None + + def correct_sample_vanadium(self, focused_ws, index, vanadium_ws=None): + raise NotImplementedError("Cannot process the sample with a vanadium run for this instrument") + + def get_default_group_names(self): return None def get_monitor_spectra_index(self, run_number): return str() - def spline_vanadium_ws(self, focused_vanadium_ws, instrument_version=''): - """ - Splines the background in a way specific to the instrument - @param focused_vanadium_ws: The workspace to perform spline backgrounds on - @param instrument_version: (Optional) Used for instruments with multiple versions - @return: List of workspaces with splined backgrounds - """ + def generate_vanadium_absorb_corrections(self, calibration_full_paths, ws_to_match): + raise NotImplementedError("Not implemented for this instrument yet") + + @staticmethod + def get_save_range(instrument_version): return None - def pearl_focus_tof_rebinning(self, input_workspace): - return input_workspace + def normalise_ws(self, ws_to_correct, run_details=None): + return None def output_focused_ws(self, processed_spectra, run_details, attenuate=False): return None - def apply_solid_angle_efficiency_corr(self, ws_to_correct, run_details): - return ws_to_correct + def pearl_focus_tof_rebinning(self, input_workspace): + return input_workspace def pearl_van_calibration_tof_rebinning(self, vanadium_ws, tof_rebin_pass, return_units): return vanadium_ws - def _generate_vanadium_absorb_corrections(self, calibration_full_paths, ws_to_match): - raise NotImplementedError("Not implemented for this instrument yet") - def pearl_rebin_to_workspace(self, ws_to_rebin, ws_to_match): return ws_to_rebin - def correct_sample_vanadium(self, focused_ws, index, vanadium_ws=None): - raise NotImplementedError("Cannot process the sample with a vanadium run for this instrument") - - def calculate_focus_binning_params(self, sample): + def spline_vanadium_ws(self, focused_vanadium_ws, instrument_version=''): return None - def _old_api_pearl_setup_input_dirs(self, run_number): - return None + # Support for old API - can be removed when Pearl_routines is removed def _old_api_pearl_filename_is_full_path(self): - """ - Only used by PEARL to maintain compatibility with old routines code - @return: Whether the "filename" is actually a full path - """ return False + def _old_api_pearl_setup_input_dirs(self, run_number): + return None + # ----- Private Implementation ----- # # These should only be called by the abstract instrument class diff --git a/scripts/Diffraction/isis_powder/pearl.py b/scripts/Diffraction/isis_powder/pearl.py index 687a3498778e33bc45aef131c1509330df65c536..1d6b8994cbccde91e4e1d02b5572301d44903630 100644 --- a/scripts/Diffraction/isis_powder/pearl.py +++ b/scripts/Diffraction/isis_powder/pearl.py @@ -169,7 +169,7 @@ class Pearl(AbstractInst): return out_ws - def _generate_vanadium_absorb_corrections(self, run_details, ws_to_match): + def generate_vanadium_absorb_corrections(self, run_details, ws_to_match): return pearl_algs.generate_vanadium_absorb_corrections(van_ws=ws_to_match) def pearl_rebin_to_workspace(self, ws_to_rebin, ws_to_match): diff --git a/scripts/Diffraction/isis_powder/polaris.py b/scripts/Diffraction/isis_powder/polaris.py index f54fb8b5e88c804773a1ba0d05c77c7c14268d35..9e6758de684e6e64cfc3caba6d38d022be049ff1 100644 --- a/scripts/Diffraction/isis_powder/polaris.py +++ b/scripts/Diffraction/isis_powder/polaris.py @@ -115,7 +115,7 @@ class Polaris(AbstractInst): return output - def _generate_vanadium_absorb_corrections(self, calibration_full_paths, ws_to_match): + def generate_vanadium_absorb_corrections(self, calibration_full_paths, ws_to_match): return polaris_algs.generate_absorb_corrections(ws_to_match=ws_to_match) def calculate_focus_binning_params(self, sample): diff --git a/scripts/Diffraction/isis_powder/routines/calibrate.py b/scripts/Diffraction/isis_powder/routines/calibrate.py index afc0a8a29910bce0858129b82129660eca564dc0..2fbdad751cdbdf06597db4a0f882ee9c2e3c8f33 100644 --- a/scripts/Diffraction/isis_powder/routines/calibrate.py +++ b/scripts/Diffraction/isis_powder/routines/calibrate.py @@ -65,7 +65,7 @@ def _apply_absorb_corrections(instrument, run_details, corrected_van_ws, gen_abs corrected_van_ws = mantid.ConvertUnits(InputWorkspace=corrected_van_ws, Target="Wavelength") if gen_absorb or not run_details.vanadium_absorption: - absorb_ws = instrument._generate_vanadium_absorb_corrections(run_details, corrected_van_ws) + absorb_ws = instrument.generate_vanadium_absorb_corrections(run_details, corrected_van_ws) else: absorb_ws = mantid.LoadNexus(Filename=run_details.vanadium_absorption)