From 5c253a578c5d5c5f067a5f0324f4ff38e039df1d Mon Sep 17 00:00:00 2001 From: Dacheng Xu Date: Wed, 21 Feb 2024 19:48:58 +0800 Subject: [PATCH] Copy time of hitlets before clip it (#1338) --- straxen/plugins/peaklets/peaklets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/straxen/plugins/peaklets/peaklets.py b/straxen/plugins/peaklets/peaklets.py index fd47542a9..0ff6354cb 100644 --- a/straxen/plugins/peaklets/peaklets.py +++ b/straxen/plugins/peaklets/peaklets.py @@ -251,9 +251,10 @@ def compute(self, records, start, end): # Extend hits into hitlets and clip at chunk boundaries: hitlets["time"] -= (hitlets["left"] - hitlets["left_integration"]) * hitlets["dt"] hitlets["length"] = hitlets["right_integration"] - hitlets["left_integration"] - self.clip_peaklet_times(hitlets, start, end) hitlets = strax.sort_by_time(hitlets) + hitlets_time = np.copy(hitlets["time"]) + self.clip_peaklet_times(hitlets, start, end) rlinks = strax.record_links(records) # If sum_waveform_top_array is false, don't digitize the top array @@ -313,7 +314,7 @@ def compute(self, records, start, end): # possibly due to its currently primitive scheduling. hitlet_time_shift = (hitlets["left"] - hitlets["left_integration"]) * hitlets["dt"] hit_max_times = ( - hitlets["time"] + hitlet_time_shift + hitlets_time + hitlet_time_shift ) # add time shift again to get correct maximum hit_max_times += hitlets["dt"] * hit_max_sample(records, hitlets)