Skip to content
Snippets Groups Projects
Commit 5a23046f authored by Joe Ramsay's avatar Joe Ramsay
Browse files

Move empty inst check to method on inst object

parent 9d13fc2b
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,12 @@ class AbstractInst(object): ...@@ -80,6 +80,12 @@ class AbstractInst(object):
self._beam_parameters = {'height': height, self._beam_parameters = {'height': height,
'width': width} 'width': width}
def should_subtract_empty_inst(self):
"""
:return: Whether the empty run should be subtracted from a run being focused
"""
return True
# Mandatory overrides # Mandatory overrides
def _get_run_details(self, run_number_string): def _get_run_details(self, run_number_string):
......
...@@ -67,6 +67,9 @@ class Pearl(AbstractInst): ...@@ -67,6 +67,9 @@ class Pearl(AbstractInst):
cross_correlate_params=cross_correlate_params, cross_correlate_params=cross_correlate_params,
get_det_offset_params=get_detector_offsets_params) get_det_offset_params=get_detector_offsets_params)
def should_subtract_empty_inst(self):
return self._inst_settings.subtract_empty_inst
@contextmanager @contextmanager
def _apply_temporary_inst_settings(self, kwargs): def _apply_temporary_inst_settings(self, kwargs):
self._switch_long_mode_inst_settings(kwargs.get("long_mode")) self._switch_long_mode_inst_settings(kwargs.get("long_mode"))
......
...@@ -25,9 +25,7 @@ def _focus_one_ws(input_workspace, run_number, instrument, perform_vanadium_norm ...@@ -25,9 +25,7 @@ def _focus_one_ws(input_workspace, run_number, instrument, perform_vanadium_norm
_test_splined_vanadium_exists(instrument, run_details) _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 # 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 \ if not common.runs_overlap(run_number, run_details.empty_runs) and instrument.should_subtract_empty_inst():
(not hasattr(instrument._inst_settings, "subtract_empty_inst") or
instrument._inst_settings.subtract_empty_inst):
input_workspace = common.subtract_summed_runs(ws_to_correct=input_workspace, instrument=instrument, input_workspace = common.subtract_summed_runs(ws_to_correct=input_workspace, instrument=instrument,
empty_sample_ws_string=run_details.empty_runs) empty_sample_ws_string=run_details.empty_runs)
......
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