diff --git a/docs/source/release/v4.3.0/diffraction.rst b/docs/source/release/v4.3.0/diffraction.rst index 04f25c089a719ede44dcebb04b9673ca7e98df45..f1a28d7c39f87201fd335e799cf7c15329dca3e9 100644 --- a/docs/source/release/v4.3.0/diffraction.rst +++ b/docs/source/release/v4.3.0/diffraction.rst @@ -39,6 +39,7 @@ Powder Diffraction ------------------ - A bug has been fixed that prevented unicode strings being given as a lim file directory in polaris create_total_scattering_pdf merging banks. +- A bug has been fixed that caused empty runs to be subtracted twice when specifying `sample_empty` in `Polaris.focus`. Engineering Diffraction ----------------------- diff --git a/scripts/Diffraction/isis_powder/routines/focus.py b/scripts/Diffraction/isis_powder/routines/focus.py index 8f59f2796566a0c2a7aa673b58f3ca5fa135e465..ff35d340f43bbbc3cda72a3c20ed19c5d616e79f 100644 --- a/scripts/Diffraction/isis_powder/routines/focus.py +++ b/scripts/Diffraction/isis_powder/routines/focus.py @@ -32,13 +32,14 @@ def _focus_one_ws(input_workspace, run_number, instrument, perform_vanadium_norm if perform_vanadium_norm: _test_splined_vanadium_exists(instrument, run_details) - # Subtract empty instrument runs, as long as this run isn't an empty and user hasn't turned empty subtraction off - if not common.runs_overlap(run_number, run_details.empty_runs) and instrument.should_subtract_empty_inst(): + # Subtract empty instrument runs, as long as this run isn't an empty, user hasn't turned empty subtraction off, or + # The user has not supplied a sample empty + is_run_empty = common.runs_overlap(run_number, run_details.empty_runs) + if not is_run_empty and instrument.should_subtract_empty_inst() and not run_details.sample_empty: input_workspace = common.subtract_summed_runs(ws_to_correct=input_workspace, instrument=instrument, empty_sample_ws_string=run_details.empty_runs) - - # Subtract a sample empty if specified - if run_details.sample_empty: + elif run_details.sample_empty: + # Subtract a sample empty if specified input_workspace = common.subtract_summed_runs(ws_to_correct=input_workspace, instrument=instrument, empty_sample_ws_string=run_details.sample_empty, scale_factor=instrument._inst_settings.sample_empty_scale)