From c8791a616c0b0dbb61d2a20da30c23635b738a77 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Wed, 9 Sep 2026 14:37:17 +0200 Subject: [PATCH] Add flipper log delay correction --- eos/options.py | 9 +++++++++ eos/reduction_reflectivity.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/eos/options.py b/eos/options.py index 5a9aebd..5c47129 100644 --- a/eos/options.py +++ b/eos/options.py @@ -499,6 +499,15 @@ class ReflectivityReductionConfig(ArgParsable): }, ) + flipperMaxDelay: int = field( + default=4, + metadata={ + 'short': 'fmd', + 'group': 'data manicure', + 'help': 'Remove all neutron pulses that are within flipperMaxDelay of a change in spin state', + }, + ) + class OutputFomatOption(StrEnum): Rqz_ort = "Rqz.ort" Rqz_orb = "Rqz.orb" diff --git a/eos/reduction_reflectivity.py b/eos/reduction_reflectivity.py index 7d92b88..3b75bc9 100644 --- a/eos/reduction_reflectivity.py +++ b/eos/reduction_reflectivity.py @@ -185,7 +185,9 @@ class ReflectivityReduction: for pi in pols: plabel = const.polarizationLabels[pi] pol_filter = FilterByLog(f'polarization_config_label=={pi}', - remove_switchpulse=True) | ApplyMask() + remove_switchpulse=True, + pre_switch=self.config.reduction.flipperMaxDelay + ) | ApplyMask() logging.info(f' filter {plabel} using polarization_config_label=={pi}') pol_filter(self.dataset) self.dataset.update_header(self.header)