diff --git a/NuRadioReco/framework/base_trace.py b/NuRadioReco/framework/base_trace.py index a67902ad2..de62d591a 100644 --- a/NuRadioReco/framework/base_trace.py +++ b/NuRadioReco/framework/base_trace.py @@ -336,11 +336,11 @@ def add_to_trace(self, channel): if t0_channel < t0_readout: i_start_readout = 0 t_start_readout = t0_readout - i_start_channel = int((t0_readout-t0_channel) * sampling_rate_channel) + 1 # The first bin of channel inside readout + i_start_channel = int(np.ceil((t0_readout - t0_channel) * sampling_rate_channel)) # The first bin of channel inside readout t_start_channel = tt_channel[i_start_channel] # 3. Channel starts after readout window: elif t0_channel >= t0_readout: - i_start_readout = int((t0_channel-t0_readout) * sampling_rate_readout) # The bin of readout right before channel starts + i_start_readout = int(np.floor((t0_channel - t0_readout) * sampling_rate_readout)) # The bin of readout right before channel starts t_start_readout = tt_readout[i_start_readout] i_start_channel = 0 t_start_channel = t0_channel @@ -349,11 +349,11 @@ def add_to_trace(self, channel): if t1_channel >= t1_readout: i_end_readout = n_samples_readout - 1 t_end_readout = t1_readout - i_end_channel = int((t1_readout - t0_channel) * sampling_rate_channel) + 1 # The bin of channel right after readout ends + i_end_channel = int(np.ceil((t1_readout - t0_channel) * sampling_rate_channel)) # The bin of channel right after readout ends t_end_channel = tt_channel[i_end_channel] # 5. Channel ends before readout window: elif t1_channel < t1_readout: - i_end_readout = int((t1_channel - t0_readout) * sampling_rate_readout) # The bin of readout right before channel ends + i_end_readout = int(np.floor((t1_channel - t0_readout) * sampling_rate_readout)) # The bin of readout right before channel ends t_end_readout = tt_readout[i_end_readout] i_end_channel = n_samples_channel - 1 t_end_channel = t1_channel