From b62c0ad2ab3baf70f4cbeb3dcfff028831013fd6 Mon Sep 17 00:00:00 2001 From: Mat Doucet Date: Fri, 10 May 2024 16:36:56 -0400 Subject: [PATCH] add 30 Hz dead time (#33) * add 30 Hz dead time * add 30 Hz dead time --- reduction/lr_reduction/DeadTimeCorrection.py | 5 +++++ reduction/lr_reduction/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/reduction/lr_reduction/DeadTimeCorrection.py b/reduction/lr_reduction/DeadTimeCorrection.py index caf09f6..62f5889 100644 --- a/reduction/lr_reduction/DeadTimeCorrection.py +++ b/reduction/lr_reduction/DeadTimeCorrection.py @@ -65,6 +65,11 @@ def PyExec(self): t_series = np.asarray(_ws_sc.getRun()['proton_charge'].value) non_zero = t_series > 0 n_pulses = np.count_nonzero(non_zero) + + # If we skip pulses, we need to account for them when computing the + # instantaneous rate + chopper_speed = _ws_sc.getRun()['SpeedRequest1'].value[0] + n_pulses = n_pulses * chopper_speed / 60.0 rate = counts_ws.readY(0) / n_pulses # Compute the dead time correction for each TOF bin diff --git a/reduction/lr_reduction/__init__.py b/reduction/lr_reduction/__init__.py index c062e27..6c7805f 100644 --- a/reduction/lr_reduction/__init__.py +++ b/reduction/lr_reduction/__init__.py @@ -1 +1 @@ -__version__ = '2.0.26' +__version__ = '2.0.27'