[new] added function to calculate symmetrized pickerror on the fly

This commit is contained in:
2016-09-21 14:12:58 +02:00
parent ca7ce5f13c
commit 80e0ca99d7
2 changed files with 15 additions and 1 deletions

View File

@@ -103,7 +103,7 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealth_mode=False):
# by weighting latest possible pick two times earliest possible pick
diffti_tl = LPick - Pick1
diffti_te = Pick1 - EPick
PickError = (diffti_te + 2 * diffti_tl) / 3
PickError = symmetrize_error(diffti_te, diffti_tl)
if iplot > 1:
p = plt.figure(iplot)
@@ -325,6 +325,17 @@ def crossings_nonzero_all(data):
return ((pos[:-1] & npos[1:]) | (npos[:-1] & pos[1:])).nonzero()[0]
def symmetrize_error(dte, dtl):
"""
takes earliest and latest possible pick and returns the symmetrized pick
uncertainty value
:param dte: relative lower uncertainty
:param dtl: relative upper uncertainty
:return: symmetrized error
"""
return (dte + 2 * dtl) / 3
def getSNR(X, TSNR, t1, tracenum=0):
'''
Function to calculate SNR of certain part of seismogram relative to