diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index ef7a1f6c..c5c9804c 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -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( diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index c3d8c103..9322f64a 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -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