Cleaned up source code, debuged: calculates now T/4 instead of T/8 out of zero crossings.

This commit is contained in:
Ludger Küperkoch 2015-03-30 14:18:19 +02:00
parent 0ad7e629ce
commit bebe3a3c45

View File

@ -43,7 +43,6 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
LPick = None
EPick = None
PickError = None
if Pick1 is not None:
print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...'
x = X[0].data
@ -85,10 +84,10 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
zc.append(t[isignal][i])
if len(zc) == 3:
break
#calculate maximum period of signal out of zero crossings
Ts = max(np.diff(zc))
#Ts/4 is assumed as time difference between most likely and earliest possible pick!
EPick = Pick1 - Ts/4
#calculate maximum period T0 of signal out of zero crossings
T0 = max(np.diff(zc)) #this is half wave length!
#T0/4 is assumed as time difference between most likely and earliest possible pick!
EPick = Pick1 - T0/2
#get symmetric pick error as mean from earliest and latest possible pick
#by weighting latest possible pick two times earliest possible pick
@ -120,10 +119,6 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
raw_input()
plt.close(iplot)
elif Pick1 == None:
print 'earllatepicker: No initial onset time given! Check input!'
return
return EPick, LPick, PickError
if __name__ == "__main__":