Skip to content
Snippets Groups Projects
Commit 6328223a authored by Harriet Brown's avatar Harriet Brown
Browse files

Fix bug causing empty runs to be subtracted twice

This Commit fixes a bug in Polaris.focus that resulted in empty runs to be subtracted twice if the user specifies a sample_empty, the function would subtract first the empty runs specified in the config maps, then the runs specified in sample_empty.

re: #27699
parent 5f1bc311
No related branches found
No related tags found
No related merge requests found
......@@ -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
-----------------------
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment