[Bugfix] Take into account None for Perror, removed needles parameters.
This commit is contained in:
parent
cb38651898
commit
66da4bd442
@ -582,8 +582,6 @@ def writephases(arrivals, fformat, filename, parameter, eventinfo=None):
|
|||||||
fid = open("%s" % filename, 'w')
|
fid = open("%s" % filename, 'w')
|
||||||
# write header
|
# write header
|
||||||
fid.write('%s, event %s \n' % (parameter.get('database'), parameter.get('eventID')))
|
fid.write('%s, event %s \n' % (parameter.get('database'), parameter.get('eventID')))
|
||||||
errP = parameter.get('timeerrorsP')
|
|
||||||
errS = parameter.get('timeerrorsS')
|
|
||||||
for key in arrivals:
|
for key in arrivals:
|
||||||
# P onsets
|
# P onsets
|
||||||
if arrivals[key].has_key('P'):
|
if arrivals[key].has_key('P'):
|
||||||
|
@ -450,16 +450,19 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
|||||||
[SNRP, SNRPdB, Pnoiselevel] = getSNR(z_copy, tsnrz, mpickP)
|
[SNRP, SNRPdB, Pnoiselevel] = getSNR(z_copy, tsnrz, mpickP)
|
||||||
|
|
||||||
# weight P-onset using symmetric error
|
# weight P-onset using symmetric error
|
||||||
if Perror <= timeerrorsP[0]:
|
if Perror == None:
|
||||||
Pweight = 0
|
|
||||||
elif timeerrorsP[0] < Perror <= timeerrorsP[1]:
|
|
||||||
Pweight = 1
|
|
||||||
elif timeerrorsP[1] < Perror <= timeerrorsP[2]:
|
|
||||||
Pweight = 2
|
|
||||||
elif timeerrorsP[2] < Perror <= timeerrorsP[3]:
|
|
||||||
Pweight = 3
|
|
||||||
elif Perror > timeerrorsP[3]:
|
|
||||||
Pweight = 4
|
Pweight = 4
|
||||||
|
else:
|
||||||
|
if Perror <= timeerrorsP[0]:
|
||||||
|
Pweight = 0
|
||||||
|
elif timeerrorsP[0] < Perror <= timeerrorsP[1]:
|
||||||
|
Pweight = 1
|
||||||
|
elif timeerrorsP[1] < Perror <= timeerrorsP[2]:
|
||||||
|
Pweight = 2
|
||||||
|
elif timeerrorsP[2] < Perror <= timeerrorsP[3]:
|
||||||
|
Pweight = 3
|
||||||
|
elif Perror > timeerrorsP[3]:
|
||||||
|
Pweight = 4
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# get first motion of P onset
|
# get first motion of P onset
|
||||||
|
Loading…
Reference in New Issue
Block a user