From a450189ba2bb698ae1eac98a911c5152d6cff2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Wed, 9 Aug 2017 17:37:11 +0200 Subject: [PATCH 1/2] Take empty trace into account. --- pylot/core/pick/autopick.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 40b8a39d..485cc664 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -826,7 +826,14 @@ def autopickstation(wfstream, pickparam, verbose=False, ax1.set_ylim([-1.5, 1.5]) ax1.set_ylabel('Normalized Counts') # fig.suptitle(tr_filt.stats.starttime) - + try: + len(edat[0]) + except: + edat = ndat + try: + len(ndat[0]) + except: + ndat = edat if len(edat[0]) > 1 and len(ndat[0]) > 1 and Sflag == 1: # plot horizontal traces ax2 = fig.add_subplot(3, 1, 2, sharex=ax1) @@ -953,9 +960,14 @@ def autopickstation(wfstream, pickparam, verbose=False, else: # dummy values (start of seismic trace) in order to derive # theoretical onset times for iteratve picking - lpickS = edat[0].stats.starttime + timeerrorsS[3] - epickS = edat[0].stats.starttime - timeerrorsS[3] - mpickS = edat[0].stats.starttime + try: + lpickS = edat[0].stats.starttime + timeerrorsS[3] + epickS = edat[0].stats.starttime - timeerrorsS[3] + mpickS = edat[0].stats.starttime + except: + lpickS = ndat[0].stats.starttime + timeerrorsS[3] + epickS = ndat[0].stats.starttime - timeerrorsS[3] + mpickS = ndat[0].stats.starttime # create dictionary # for P phase @@ -965,8 +977,12 @@ def autopickstation(wfstream, pickparam, verbose=False, snrdb=SNRPdB, weight=Pweight, fm=FM, w0=None, fc=None, Mo=None, Mw=None, picker=picker, marked=Pmarker) # add S phase - ccode = edat[0].stats.channel - ncode = edat[0].stats.network + try: + ccode = edat[0].stats.channel + ncode = edat[0].stats.network + except: + ccode = ndat[0].stats.channel + ncode = ndat[0].stats.network spick = dict(channel=ccode, network=ncode, lpp=lpickS, epp=epickS, mpp=mpickS, spe=Serror, snr=SNRS, snrdb=SNRSdB, weight=Sweight, fm=None, picker=picker, Ao=Ao) # merge picks into returning dictionary From 1ed4f73e5cff054e69170f634bc695ab3e4ce753 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Thu, 10 Aug 2017 11:04:46 +0200 Subject: [PATCH 2/2] [bugfix] darius: comparison of P-pick slope to minAIC-S-slope instead of S-pick slope --- pylot/core/pick/autopick.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 485cc664..7162bcd0 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -580,7 +580,7 @@ def autopickstation(wfstream, pickparam, verbose=False, aictsmoothS, fig=fig) ############################################################### # go on with processing if AIC onset passes quality control - slope = aicpick.getSlope() + slope = aicarhpick.getSlope() if not slope: slope = 0 if (slope >= minAICSslope and