From 1dacc08b264920c25b87b2d4e1448f833d32a7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 15 Aug 2017 16:55:20 +0200 Subject: [PATCH 1/4] Leave picking parameters for onsets with small residuum unchanged. --- pylot/core/pick/autopick.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index ef7a1f6c..c274b7ff 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -50,7 +50,7 @@ def autopickevent(data, param, iplot=0, fig_dict=None, ncores=0, metadata=None, continue for station in stations: - topick = data.select(station=station) + topick = data.select(station='AWL') if iplot == None or iplot == 'None' or iplot == 0: input_tuples.append((topick, param, apverbose, metadata, origin)) @@ -1057,17 +1057,21 @@ def iteratepicker(wf, NLLocfile, picks, badpicks, pickparameter, fig_dict=None): Precalcwin_old = pickparameter.get('Precalcwin') noisefactor_old = pickparameter.get('noisefactor') zfac_old = pickparameter.get('zfac') - pickparameter.setParam( - pstart=max([0, badpicks[i][1] - wf2pick[0].stats.starttime \ - - pickparameter.get('tlta')])) - pickparameter.setParam(pstop=pickparameter.get('pstart') + \ - (pickparameter.get('Precalcwin'))) - pickparameter.setParam(sstop=pickparameter.get('sstop') / 2) - pickparameter.setParam(pickwinP=pickparameter.get('pickwinP') / 2) - pickparameter.setParam( - Precalcwin=pickparameter.get('Precalcwin') / 2) - pickparameter.setParam(noisefactor=1.0) - pickparameter.setParam(zfac=1.0) + twindows = pickparameter.get('tsnrz') + tsafety = twindows[1] + pstart = max([0, badpicks[i][1] - wf2pick[0].stats.starttime - pickparameter.get('tlta')]) + if abs(float(res)) <= tsafety / 2 or pstart == 0: + print("iteratepicker: Small residuum, leave parameters unchanged for this phase!") + else: + pickparameter.setParam(pstart=pstart) + pickparameter.setParam(pstop=pickparameter.get('pstart') + \ + (pickparameter.get('Precalcwin'))) + pickparameter.setParam(sstop=pickparameter.get('sstop') / 2) + pickparameter.setParam(pickwinP=pickparameter.get('pickwinP') / 2) + pickparameter.setParam(Precalcwin=pickparameter.get('Precalcwin') / 2) + pickparameter.setParam(noisefactor=1.0) + pickparameter.setParam(zfac=1.0) + print( "iteratepicker: The following picking parameters have been modified for iterative picking:") print( From fe8128a61a0eeb4bfd1c65ace042b06379089dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 15 Aug 2017 16:57:52 +0200 Subject: [PATCH 2/4] Use mean for noise level determination instead of max. --- pylot/core/pick/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index c3d8c103..f622cfa3 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -476,7 +476,7 @@ def getsignalwin(t, t1, tsignal): ''' # get signal window - isignal, = np.where((t <= min([t1 + tsignal, t[-1]])) \ + isignal, = np.where((t <= min([t1 + tsignal, len(t)])) \ & (t >= t1)) if np.size(isignal) < 1: print("getsignalwin: Empty array isignal, check signal window!") @@ -754,7 +754,7 @@ def checksignallength(X, pick, TSNR, minsiglength, nfac, minpercent, iplot=0, fi # get signal window isignal = getsignalwin(t, pick, minsiglength) # calculate minimum adjusted signal level - minsiglevel = max(rms[inoise]) * nfac + minsiglevel = np.mean(rms[inoise]) * nfac # minimum adjusted number of samples over minimum signal level minnum = len(isignal) * minpercent / 100 # get number of samples above minimum adjusted signal level From cc25a8e6cf0cd45ab937cf464d962a6a4f3d5ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 15 Aug 2017 17:01:27 +0200 Subject: [PATCH 3/4] Rearranged changes accidently got lost by former commit. --- pylot/core/pick/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index f622cfa3..9322f64a 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -476,7 +476,7 @@ def getsignalwin(t, t1, tsignal): ''' # get signal window - isignal, = np.where((t <= min([t1 + tsignal, len(t)])) \ + isignal, = np.where((t <= min([t1 + tsignal, t[-1]])) \ & (t >= t1)) if np.size(isignal) < 1: print("getsignalwin: Empty array isignal, check signal window!") From 95a2f216753022d720b60f4b4754306a2c2c4a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 15 Aug 2017 17:02:50 +0200 Subject: [PATCH 4/4] Removed hard coded station name introduced for bug fixing. --- 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 c274b7ff..c5c9804c 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -50,7 +50,7 @@ def autopickevent(data, param, iplot=0, fig_dict=None, ncores=0, metadata=None, continue for station in stations: - topick = data.select(station='AWL') + topick = data.select(station=station) if iplot == None or iplot == 'None' or iplot == 0: input_tuples.append((topick, param, apverbose, metadata, origin))