Skip to content

Commit

Permalink
Compatible with XENONnT/straxen#1513 (#98)
Browse files Browse the repository at this point in the history
* Compatible with XENONnT/straxen#1513

* Inherit `find_n_competing`
  • Loading branch information
dachengx authored Feb 7, 2025
1 parent e73d316 commit 6131a94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions axidence/plugins/salting/peak_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def infer_dtype(self):
return dtype

def compute(self, peaks_salted, peaks):
windows = strax.touching_windows(peaks, peaks_salted, window=self.nearby_window)
mask = np.isin(peaks["type"], [1, 2])
windows = strax.touching_windows(peaks[mask], peaks_salted, window=self.nearby_window)
n_left, n_tot = self.find_n_competing(
peaks, peaks_salted, windows, fraction=self.min_area_fraction
peaks[mask], peaks_salted, windows, fraction=self.min_area_fraction
)
return dict(
time=peaks_salted["time"],
Expand Down

0 comments on commit 6131a94

Please sign in to comment.