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)