diff --git a/docs/source/release/v4.1.0/diffraction.rst b/docs/source/release/v4.1.0/diffraction.rst index 6d0c3c55a577fbf0824ea7e211b5c16aaa09f932..406aa263ed068d9e8a64ed07564401ace16403f9 100644 --- a/docs/source/release/v4.1.0/diffraction.rst +++ b/docs/source/release/v4.1.0/diffraction.rst @@ -19,7 +19,7 @@ New Algorithms Improvements ############ -- The Gem scripts can now be used to automatically generate a .cal file, similar to pearl. +- The Gem scripts can now be used to automatically generate a .cal file, similar to pearl. They can also adjust a parameter file passed in using the argument "calibration_to_adjust". - The Polaris scripts can now detect the chopper mode if none is provided using the frequency block logs. diff --git a/docs/source/techniques/ISISPowder-GEM-v1.rst b/docs/source/techniques/ISISPowder-GEM-v1.rst index dc334d2ec9aae1db17930803d68a3624c38f9e18..a580d0e2424196597da03e6682470f11ef5f1426 100644 --- a/docs/source/techniques/ISISPowder-GEM-v1.rst +++ b/docs/source/techniques/ISISPowder-GEM-v1.rst @@ -177,12 +177,17 @@ Example create_cal ^^^^^^^^^^ -The *create_cal* method creates the offset calibration file for GEM -scripts. The following parameters are required: +The *create_cal* method creates the offset calibration file for GEM, or if one is passed in, adjusts +an existing file. +The following parameters are required: - :ref:`calibration_mapping_file_gem_isis-powder-diffraction-ref` - :ref:`run_number_pearl_isis-powder-diffraction-ref` +The Following parameter may also be set + +- :ref:`calibration_to_adjust_gem_isis-powder-diffraction-ref` + Example ======= @@ -256,6 +261,15 @@ Parameters The following parameters for GEM are intended for regular use when using the ISIS Powder scripts. +.. _calibration_to_adjust_gem_isis-powder-diffraction-ref: + +calibration_to_adjust +^^^^^^^^^^^^^^^^^^^^^ +*Optional* + +This Parameter contains the path to an offsets .cal file to adjust using +the automatic cal file generation. + .. _calibration_directory_gem_isis-powder-diffraction-ref: calibration_directory diff --git a/scripts/Diffraction/isis_powder/gem.py b/scripts/Diffraction/isis_powder/gem.py index 68e7e0b349b4f8ea8c9b22d32e135d10ff4c5070..abde7faa9159db4cbc6178b3ab087e9b458a1f11 100644 --- a/scripts/Diffraction/isis_powder/gem.py +++ b/scripts/Diffraction/isis_powder/gem.py @@ -44,7 +44,6 @@ class Gem(AbstractInst): do_absorb_corrections=self._inst_settings.do_absorb_corrections) def create_cal(self, **kwargs): - print(hasattr(self._inst_settings, "calibration_to_adjust")) self._switch_texture_mode_specific_inst_settings(kwargs.get("texture_mode")) self._inst_settings.update_attributes(kwargs=kwargs) self._inst_settings.update_attributes(advanced_config=gem_advanced_config.get_calibration_variables()) @@ -59,8 +58,8 @@ class Gem(AbstractInst): "Step": self._inst_settings.get_det_offsets_step, "XMin": self._inst_settings.get_det_offsets_x_min, "XMax": self._inst_settings.get_det_offsets_x_max} - if hasattr(self._inst_settings, "calibration_to_adjust"): - return gem_calibration_algs.create_calibration(calibration_runs=self._inst_settings.run_number, + if self._inst_settings.cal_adjust: + return gem_calibration_algs.adjust_calibration(calibration_runs=self._inst_settings.run_number, instrument=self, offset_file_name=run_details.offset_file_path, grouping_file_name=run_details.grouping_file_path, @@ -68,8 +67,9 @@ class Gem(AbstractInst): rebin_1_params=self._inst_settings.cal_rebin_1, rebin_2_params=self._inst_settings.cal_rebin_2, cross_correlate_params=cross_correlate_params, - get_det_offset_params=get_detector_offsets_params) - return gem_calibration_algs.adjust_calibration(calibration_runs=self._inst_settings.run_number, + get_det_offset_params=get_detector_offsets_params, + original_cal=self._inst_settings.cal_adjust) + return gem_calibration_algs.create_calibration(calibration_runs=self._inst_settings.run_number, instrument=self, offset_file_name=run_details.offset_file_path, grouping_file_name=run_details.grouping_file_path, @@ -77,8 +77,7 @@ class Gem(AbstractInst): rebin_1_params=self._inst_settings.cal_rebin_1, rebin_2_params=self._inst_settings.cal_rebin_2, cross_correlate_params=cross_correlate_params, - get_det_offset_params=get_detector_offsets_params, - original_cal =self._inst_settings.cal_adjust) + get_det_offset_params=get_detector_offsets_params) def set_sample_details(self, **kwargs): kwarg_name = "sample" @@ -143,8 +142,8 @@ class Gem(AbstractInst): output_mode=output_mode) else: d_spacing_group, \ - tof_group = common_output.split_into_tof_d_spacing_groups(run_details=run_details, - processed_spectra=processed_spectra) + tof_group = common_output.split_into_tof_d_spacing_groups(run_details=run_details, + processed_spectra=processed_spectra) if self._is_vanadium: return d_spacing_group, tof_group