Skip to content

Commit

Permalink
Merge pull request #23 from splendor-collab/bug/negative_pulse_trigge…
Browse files Browse the repository at this point in the history
…ring

Fix negative pulse triggering
  • Loading branch information
slwatkins authored Nov 1, 2024
2 parents ec828c8 + a61965b commit 3288057
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 3288057

Please sign in to comment.