Skip to content

Commit

Permalink
fix negative pulse triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
slwatkins authored Nov 1, 2024
1 parent ec828c8 commit a61965b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/splendaq/daq/_offline_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,20 +518,18 @@ def acquire_pulses(self, template, psd, threshold_on, tchan, threshold_off=None,

for kk, filt in enumerate(filtered):

if posthreshold:
ranges = EventBuilder._smart_trigger(
filt, self._threshold_on, self._threshold_off, mergewindow,
)
else:
ranges = EventBuilder._smart_trigger(
-filt, -self._threshold_on, -self._threshold_off, mergewindow,
)
ranges = EventBuilder._smart_trigger(
sign * filt,
sign * self._threshold_on,
sign * self._threshold_off,
mergewindow,
)

if len(ranges)==0:
break

for ind0, ind1 in zip(ranges[:, 0], ranges[:, 1]):
indmax = ind0 + np.argmax(filt[ind0:ind1])
indmax = ind0 + np.argmax(sign * filt[ind0:ind1])
evtinds_list.append([indmax - self._tracelength//2])
triginds_list.append([indmax])
evtamps_list.append([filt[indmax]])
Expand Down

0 comments on commit a61965b

Please sign in to comment.