From beb8b43d0852c6f8eb203804e7919dc437b0cf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henning=20Schulze=20Ei=C3=9Fing?= Date: Thu, 12 Sep 2024 14:29:13 +0200 Subject: [PATCH] Make sure CDF goes to 1 smoothly (#261) * Make sure CDF goes to 1 smoothly * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- fuse/plugins/pmt_and_daq/pmt_response_and_daq.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fuse/plugins/pmt_and_daq/pmt_response_and_daq.py b/fuse/plugins/pmt_and_daq/pmt_response_and_daq.py index d7c6a088..2a827295 100644 --- a/fuse/plugins/pmt_and_daq/pmt_response_and_daq.py +++ b/fuse/plugins/pmt_and_daq/pmt_response_and_daq.py @@ -283,7 +283,10 @@ def init_pmt_current_templates(self): # Interpolate on cdf ensures that each spe pulse would sum up to 1 pe*sample duration^-1 pe_pulse_function = interp1d( - self.pe_pulse_ts, np.cumsum(self.pe_pulse_ys), bounds_error=False, fill_value=(0, 1) + self.pe_pulse_ts, + np.cumsum(self.pe_pulse_ys) / np.sum(self.pe_pulse_ys), + bounds_error=False, + fill_value=(0, 1), ) # Samples are always multiples of sample_duration