Skip to content

Commit

Permalink
fix logic in detector
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne authored Jun 6, 2024
1 parent 51a83aa commit 67e2310
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/10_peak_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,9 @@ def detect_peaks(self) -> NDArray[np.float64]:
The timestamps of all detected peaks.
"""
data, ts = self._stream.get_data() # we have a single channel in the stream
if self._last_acq_time is None:
if self._last_acq_time is None or self._last_acq_time != ts[-1]:
self._last_acq_time = ts[-1]
elif self._last_acq_time == ts[-1]:
self._last_acq_time = ts[-1]
return np.array([]) # nothing new to do
data = data.squeeze()
peaks, _ = find_peaks(
Expand Down

0 comments on commit 67e2310

Please sign in to comment.