From 66da4bd442372422f257e60f8f0b0910081ce29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 15 Aug 2017 12:02:46 +0200 Subject: [PATCH] [Bugfix] Take into account None for Perror, removed needles parameters. --- pylot/core/io/phases.py | 2 -- pylot/core/pick/autopick.py | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index c85d2727..3002680b 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -582,8 +582,6 @@ def writephases(arrivals, fformat, filename, parameter, eventinfo=None): fid = open("%s" % filename, 'w') # write header fid.write('%s, event %s \n' % (parameter.get('database'), parameter.get('eventID'))) - errP = parameter.get('timeerrorsP') - errS = parameter.get('timeerrorsS') for key in arrivals: # P onsets if arrivals[key].has_key('P'): diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 9e9e7857..1bb2527f 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -450,16 +450,19 @@ def autopickstation(wfstream, pickparam, verbose=False, [SNRP, SNRPdB, Pnoiselevel] = getSNR(z_copy, tsnrz, mpickP) # weight P-onset using symmetric error - 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]: + if Perror == None: 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