diff --git a/docs/source/api/python/techniques/ISISPowder-v1.rst b/docs/source/api/python/techniques/ISISPowder-v1.rst index e24a7970aa30a0b7a09955812cf77b649bdae3de..aa73b5a8abe64a3dcba75bb0b97c6afb1c728177 100644 --- a/docs/source/api/python/techniques/ISISPowder-v1.rst +++ b/docs/source/api/python/techniques/ISISPowder-v1.rst @@ -222,7 +222,7 @@ TODO talk about defaults? on them if there are multiple runs specified. - `tt_mode` - Specifies the detectors to be considered. - Acceptable options: `tt35`, `tt70`, `tt88`. + Acceptable options: `tt35`, `tt70`, `tt88`, `all` (when creating vanadium). - `user_name` - Used to create a folder with that name in the output directory @@ -342,7 +342,7 @@ Vanadium Calibration ^^^^^^^^^^^^^^^^^^^^^ Following on from the examples configuring the scripts (see: :ref:`pearl_config_scripts_isis-powder-diffraction-ref`) we can run a vanadium -calibration with the `create_calibration_vanadium` method. +calibration with the `create_vanadium` method. TODO the following parameters are needed... @@ -350,9 +350,9 @@ TODO the following parameters are needed... # Lets use the "pearl_object_override" which stores in "My custom location" # from the previous examples - pearl_object_override.create_calibration_vanadium(run_in_range=12345, - do_absorb_corrections=True - long_mode=False, tt_mode=tt88) + pearl_object_override.create_vanadium(run_in_range=12345, + do_absorb_corrections=True + long_mode=False, tt_mode=tt88) This will generate a calibration for the specified vanadium and empty runs specified in the calibration mapping file (see: :ref:`pearl_cal_map_isis-powder-diffraction-ref`) @@ -575,7 +575,7 @@ The scripts can be setup in 3 ways: Vanadium Calibration ^^^^^^^^^^^^^^^^^^^^ Within the objects now configured we can run the vanadium calibrations. This -is done with the `create_calibration_vanadium` method. +is done with the `create_vanadium` method. This will generate a calibration for the matching vanadium and empty runs in the calibration mapping file (see :ref:`polaris_calibration_map-powder-diffraction-ref`) @@ -591,7 +591,7 @@ TODO the following parameters are needed. # Using the manually specified object where we put in the calibration folder # location when configuring the scripts - polaris_manually_specified.create_calibration_vanadium(run_in_range="123", ...) + polaris_manually_specified.create_vanadium(run_in_range="123", ...) Focusing ^^^^^^^^ diff --git a/scripts/Diffraction/isis_powder/pearl.py b/scripts/Diffraction/isis_powder/pearl.py index ece61477c5a5b5567a0c1e061549e93f8606e226..bc7e119bfe8345c1afbde9c52c94b481b0ac82fd 100644 --- a/scripts/Diffraction/isis_powder/pearl.py +++ b/scripts/Diffraction/isis_powder/pearl.py @@ -32,12 +32,20 @@ class Pearl(AbstractInst): def create_vanadium(self, **kwargs): self._switch_long_mode_inst_settings(kwargs.get("long_mode")) - kwargs["perform_attenuation"] = False + kwargs["perform_attenuation"] = False # Hard code this off as it is not implemented self._inst_settings.update_attributes(kwargs=kwargs) + if str(self._inst_settings.tt_mode).lower() == "all": + for new_tt_mode in ["tt35", "tt70", "tt88"]: + self._inst_settings.tt_mode = new_tt_mode + self._run_create_vanadium() + else: + self._run_create_vanadium() + + def _run_create_vanadium(self): + # Provides a minimal wrapper so if we have tt_mode 'all' we can loop round run_details = self._get_run_details(run_number_string=self._inst_settings.run_in_range) run_details.run_number = run_details.vanadium_run_numbers - return self._create_vanadium(vanadium_runs=run_details.vanadium_run_numbers, empty_runs=run_details.empty_runs, do_absorb_corrections=self._inst_settings.absorb_corrections) diff --git a/scripts/Diffraction/isis_powder/pearl_routines/pearl_algs.py b/scripts/Diffraction/isis_powder/pearl_routines/pearl_algs.py index c3190052d468727f7359ebc8be277fc0ed3b8474..c14ebe6cd720db56ab7186fddabbd53b5b9a1e16 100644 --- a/scripts/Diffraction/isis_powder/pearl_routines/pearl_algs.py +++ b/scripts/Diffraction/isis_powder/pearl_routines/pearl_algs.py @@ -72,8 +72,12 @@ def get_run_details(run_number_string, inst_settings): absorption_file_path = os.path.join(calibration_dir, inst_settings.van_absorb_file) calibration_file_path = os.path.join(cycle_calibration_dir, calibration_file_name) - tt_grouping_key = inst_settings.tt_mode.lower() + '_grouping' - grouping_file_path = os.path.join(calibration_dir, getattr(inst_settings, tt_grouping_key)) + tt_grouping_key = str(inst_settings.tt_mode).lower() + '_grouping' + try: + grouping_file_path = os.path.join(calibration_dir, getattr(inst_settings, tt_grouping_key)) + except AttributeError: + raise ValueError("The tt_mode: " + str(inst_settings.tt_mode).lower() + " is unknown") + splined_vanadium_path = os.path.join(cycle_calibration_dir, splined_vanadium_name) run_details = RunDetails(run_number=run_number_string)