Skip to content

Commit

Permalink
Merge pull request neuropsychology#775 from clastro/patch-1
Browse files Browse the repository at this point in the history
[Fix] fix edgecase in ecg_delineate()
  • Loading branch information
DominiqueMakowski authored Feb 9, 2023
2 parents 5dc29b8 + 3764bc1 commit 51dd657
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neurokit2/ecg/ecg_delineate.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ def _onset_offset_delineator(ecg, peaks, peak_type="rpeaks", sampling_rate=1000)
if peak_type == "rpeaks":
if wt_peaks_data["peak_heights"][0] > 0:
epsilon_offset = 0.125 * wt_peaks_data["peak_heights"][0]
else:
epsilon_offset = 0 #This is where the error occurs
elif peak_type == "ppeaks":
epsilon_offset = 0.9 * wt_peaks_data["peak_heights"][0]
elif peak_type == "tpeaks":
Expand Down

0 comments on commit 51dd657

Please sign in to comment.