Skip to content

Commit 3288057

Browse files
authored
Merge pull request #23 from splendor-collab/bug/negative_pulse_triggering
Fix negative pulse triggering
2 parents ec828c8 + a61965b commit 3288057

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/splendaq/daq/_offline_trigger.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -518,20 +518,18 @@ def acquire_pulses(self, template, psd, threshold_on, tchan, threshold_off=None,
518518

519519
for kk, filt in enumerate(filtered):
520520

521-
if posthreshold:
522-
ranges = EventBuilder._smart_trigger(
523-
filt, self._threshold_on, self._threshold_off, mergewindow,
524-
)
525-
else:
526-
ranges = EventBuilder._smart_trigger(
527-
-filt, -self._threshold_on, -self._threshold_off, mergewindow,
528-
)
521+
ranges = EventBuilder._smart_trigger(
522+
sign * filt,
523+
sign * self._threshold_on,
524+
sign * self._threshold_off,
525+
mergewindow,
526+
)
529527

530528
if len(ranges)==0:
531529
break
532530

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

0 commit comments

Comments
 (0)