From 3e042c769ac7b8e748f395171e774b3ecd84fd43 Mon Sep 17 00:00:00 2001 From: Mat Doucet Date: Fri, 9 Aug 2024 13:07:30 -0400 Subject: [PATCH] Update DeadTimeCorrection.py --- .../interfaces/data_handling/DeadTimeCorrection.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/reflectivity_ui/interfaces/data_handling/DeadTimeCorrection.py b/reflectivity_ui/interfaces/data_handling/DeadTimeCorrection.py index e2d9bc8..d4dc0af 100644 --- a/reflectivity_ui/interfaces/data_handling/DeadTimeCorrection.py +++ b/reflectivity_ui/interfaces/data_handling/DeadTimeCorrection.py @@ -95,14 +95,11 @@ def PyExec(self): ) counts_ws += _errors + # When operating at a given frequency, the proton charge of the blocked + # pulsed is zero in the data file, so we don't have to adjust the number of pulses. t_series = np.asarray(_ws_sc.getRun()["proton_charge"].value) - non_zero = t_series > 0 - n_pulses = np.count_nonzero(non_zero) + n_pulses = np.count_nonzero(t_series) - # 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