Skip to content

Commit

Permalink
Add 1 to index
Browse files Browse the repository at this point in the history
  • Loading branch information
dnowacki-usgs committed Aug 19, 2024
1 parent 3090294 commit 1f6dbe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stglib/core/waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def define_cutoff(f, Pxx, Kp, noise=0.9):

fpeakcut = 1.1 * f[np.argmax(Pxx)]
fpeakcutind = np.searchsorted(f, fpeakcut) # cutoff based on 1.1*fp
Kpcutind = np.nonzero(Kp > 0.1)[0][-1] # cutoff keeping only Kp > 0.1
Kpcutind = np.nonzero(Kp > 0.1)[0][-1] + 1 # cutoff keeping only Kp > 0.1

# take the more conservative of either K_p or noise cutoff
if (noisecutind > fpeakcutind) and (noisecutind <= Kpcutind):
Expand Down

0 comments on commit 1f6dbe5

Please sign in to comment.