Skip to content

Commit

Permalink
Copy time of hitlets before clip it (#1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Feb 21, 2024
1 parent 8eb8a16 commit 5c253a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions straxen/plugins/peaklets/peaklets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5c253a5

Please sign in to comment.