Cleaned up source code, debuged: calculates now T/4 instead of T/8 out of zero crossings.
This commit is contained in:
parent
0ad7e629ce
commit
bebe3a3c45
@ -43,7 +43,6 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
|
|||||||
LPick = None
|
LPick = None
|
||||||
EPick = None
|
EPick = None
|
||||||
PickError = None
|
PickError = None
|
||||||
if Pick1 is not None:
|
|
||||||
print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...'
|
print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...'
|
||||||
|
|
||||||
x = X[0].data
|
x = X[0].data
|
||||||
@ -85,10 +84,10 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
|
|||||||
zc.append(t[isignal][i])
|
zc.append(t[isignal][i])
|
||||||
if len(zc) == 3:
|
if len(zc) == 3:
|
||||||
break
|
break
|
||||||
#calculate maximum period of signal out of zero crossings
|
#calculate maximum period T0 of signal out of zero crossings
|
||||||
Ts = max(np.diff(zc))
|
T0 = max(np.diff(zc)) #this is half wave length!
|
||||||
#Ts/4 is assumed as time difference between most likely and earliest possible pick!
|
#T0/4 is assumed as time difference between most likely and earliest possible pick!
|
||||||
EPick = Pick1 - Ts/4
|
EPick = Pick1 - T0/2
|
||||||
|
|
||||||
#get symmetric pick error as mean from earliest and latest possible pick
|
#get symmetric pick error as mean from earliest and latest possible pick
|
||||||
#by weighting latest possible pick two times earliest 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()
|
raw_input()
|
||||||
plt.close(iplot)
|
plt.close(iplot)
|
||||||
|
|
||||||
elif Pick1 == None:
|
|
||||||
print 'earllatepicker: No initial onset time given! Check input!'
|
|
||||||
return
|
|
||||||
|
|
||||||
return EPick, LPick, PickError
|
return EPick, LPick, PickError
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user