diff --git a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py index a53d32389e4d42fe0eba38901eb751298a9c388f..609b60ac8b5f8ad6fd7f9a802a61bf86d1f1bb58 100644 --- a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py +++ b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py @@ -107,14 +107,14 @@ class TotalScatteringTest(stresstesting.MantidStressTest): def validate(self): # Whilst total scattering is in development, the validation will avoid using reference files as they will have # to be updated very frequently. In the meantime, the expected peak in the PDF at ~3.9 Angstrom will be checked. - # After rebin this is at X index 51 - expected_peak_values = [0.0187231, - 0.0583586, - 0.2241280, - 0.2752230, - 1.0252800] + # After rebin this is at X index 37 + expected_peak_values = [0.0002294, + 0.0606328, + 0.2007917, + 0.1436630, + 0.9823244] for index, ws in enumerate(self.pdf_output): - self.assertAlmostEqual(ws.dataY(0)[51], expected_peak_values[index], places=3) + self.assertAlmostEqual(ws.dataY(0)[37], expected_peak_values[index], places=3) def run_total_scattering(run_number, merge_banks): diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-POLARIS98533_FocusSempty.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-POLARIS98533_FocusSempty.nxs.md5 index d71f619510091c3f11bd1dcc9c9c3e9e0fca38b2..c18228056958b8ece48f9f48b26d9c6479837ddb 100644 --- a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-POLARIS98533_FocusSempty.nxs.md5 +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-POLARIS98533_FocusSempty.nxs.md5 @@ -1 +1 @@ -15886bcd0558ed6a6ac1dcf528daf11e +fb33507ac0702dd7d513d79e352637b4 \ No newline at end of file diff --git a/docs/source/release/v3.12.0/diffraction.rst b/docs/source/release/v3.12.0/diffraction.rst index 4567235a9efac987a371400a1fc792c66d233c7c..7c1b228a2491924824c95028aad75e724fdbd823 100644 --- a/docs/source/release/v3.12.0/diffraction.rst +++ b/docs/source/release/v3.12.0/diffraction.rst @@ -29,6 +29,7 @@ Powder Diffraction - ISIS Powder scripts for HRPD now support extra TOF windows 10-50 and 180-280 - After calling create_vanadium and focus in ISIS Powder scripts on POLARIS, the output workspaces always contain the sample material if it is set using set_sample_material. (To view the sample material, right click the workspace and click 'Sample Material...') - It is now possible to set beam parameters (height and width) using instrument_object.set_beam_parameters(height=123, width=456). +- The ``mode`` parameter for POLARIS in ISIS Powder now behaves as described in the documentation - it persists through function calls and is case insensitive Engineering Diffraction ----------------------- diff --git a/scripts/Diffraction/isis_powder/polaris.py b/scripts/Diffraction/isis_powder/polaris.py index 85afd55febe80e6d47add2e47d191412f251d145..9cd8cc7aca0b50369571fc40157d9087f0fa48d7 100644 --- a/scripts/Diffraction/isis_powder/polaris.py +++ b/scripts/Diffraction/isis_powder/polaris.py @@ -138,5 +138,8 @@ class Polaris(AbstractInst): return output def _switch_mode_specific_inst_settings(self, mode): + if mode is None and hasattr(self._inst_settings, "mode"): + mode = self._inst_settings.mode + self._inst_settings.update_attributes(advanced_config=polaris_advanced_config.get_mode_specific_dict(mode), suppress_warnings=True) 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 c447db233c11762d4ad7a6616c3e9496dd8cdedd..978617fa90503af150466c87f51ba0444a5ba345 100644 --- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py +++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py @@ -93,9 +93,15 @@ variables = { def get_mode_specific_dict(mode): - return {"focused_cropping_values": - pdf_focused_cropping_values if mode == "PDF" - else rietveld_focused_cropping_values} + if mode is None: + raise RuntimeError("Failed to supply chopper mode") + + mode = mode.lower() + if mode == "pdf": + return {"focused_cropping_values": pdf_focused_cropping_values} + if mode == "rietveld": + return {"focused_cropping_values": rietveld_focused_cropping_values} + raise ValueError("Invalid chopper mode: \"{}\"".format(mode)) def get_all_adv_variables(mode="PDF"):