Skip to content

Commit

Permalink
Compatible with XENONnT/straxen#1532 (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Jan 20, 2025
1 parent 7ab7d23 commit 2893cac
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions axidence/plugins/salting/peak_correlation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numba
import numpy as np
import strax
from straxen import PeakProximity, PeakShadow, PeakAmbience, PeakNearestTriggering, PeakSEScore
Expand Down Expand Up @@ -40,24 +39,6 @@ def compute(self, peaks_salted, peaks):
salt_number=peaks_salted["salt_number"],
)

@staticmethod
@numba.jit(nopython=True, nogil=True, cache=True)
def find_n_competing(peaks, peaks_salted, windows, fraction):
n_left = np.zeros(len(peaks_salted), dtype=np.int32)
n_tot = n_left.copy()
areas = peaks["area"]
areas_salted = peaks_salted["area"]

dig = np.searchsorted(peaks["center_time"], peaks_salted["center_time"])

for i, peak in enumerate(peaks_salted):
left_i, right_i = windows[i]
threshold = areas_salted[i] * fraction
n_left[i] = np.sum(areas[left_i : dig[i]] > threshold)
n_tot[i] = n_left[i] + np.sum(areas[dig[i] : right_i] > threshold)

return n_left, n_tot


class PeakShadowSalted(PeakShadow):
__version__ = "0.0.0"
Expand Down

0 comments on commit 2893cac

Please sign in to comment.