[bugfix] updated EPick nan fix
This commit is contained in:
parent
844708bbac
commit
217db9bbdd
@ -68,20 +68,23 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
|
|||||||
|
|
||||||
# get earliest possible pick
|
# get earliest possible pick
|
||||||
|
|
||||||
EPick = np.nan
|
EPick = np.nan; count = 0
|
||||||
pis = isignal[:len(isignal) / 2] if not len(isignal) % 2 else \
|
pis = isignal
|
||||||
isignal[:len(isignal) / 2 + 1]
|
|
||||||
|
# if EPick stays NaN the signal window size will be doubled
|
||||||
while np.isnan(EPick):
|
while np.isnan(EPick):
|
||||||
print("earllatepicker: Doubled signal window size because of NaN for "
|
if count > 0:
|
||||||
"earliest pick.")
|
print("earllatepicker: Doubled signal window size %s time(s) "
|
||||||
isigDoubleWinStart = pis[-1] + 1
|
"because of NaN for earliest pick." %count)
|
||||||
isignalDoubleWin = np.arange(isigDoubleWinStart,
|
isigDoubleWinStart = pis[-1] + 1
|
||||||
|
isignalDoubleWin = np.arange(isigDoubleWinStart,
|
||||||
isigDoubleWinStart + len(pis))
|
isigDoubleWinStart + len(pis))
|
||||||
if (isigDoubleWinStart + len(pis)) < X[0].data.size:
|
if (isigDoubleWinStart + len(pis)) < X[0].data.size:
|
||||||
pis = np.concatenate((pis, isignalDoubleWin))
|
pis = np.concatenate((pis, isignalDoubleWin))
|
||||||
else:
|
else:
|
||||||
print("Could not double signal window. Index out of bounds.")
|
print("Could not double signal window. Index out of bounds.")
|
||||||
break
|
break
|
||||||
|
count += 1
|
||||||
# determine all zero crossings in signal window (demeaned)
|
# determine all zero crossings in signal window (demeaned)
|
||||||
zc = crossings_nonzero_all(x[pis] - x[pis].mean())
|
zc = crossings_nonzero_all(x[pis] - x[pis].mean())
|
||||||
# calculate mean half period T0 of signal as the average of the
|
# calculate mean half period T0 of signal as the average of the
|
||||||
|
Loading…
Reference in New Issue
Block a user