From 08df7c33048932398bfcc6fe2ecc9714f0574e80 Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Fri, 20 May 2016 10:11:40 +0200 Subject: [PATCH] [edit] decreased unwanted verbosity --- pylot/core/active/seismicshot.py | 2 +- pylot/core/io/phases.py | 2 +- pylot/core/pick/utils.py | 17 ++++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pylot/core/active/seismicshot.py b/pylot/core/active/seismicshot.py index 68087561..dca3ddf3 100644 --- a/pylot/core/active/seismicshot.py +++ b/pylot/core/active/seismicshot.py @@ -331,7 +331,7 @@ class SeismicShot(object): self.picks[traceID]['spe']) = earllatepicker(self.getSingleStream(traceID), nfac, (tnoise, tgap, tsignal), self.getPickIncludeRemoved(traceID), - stealthMode=True) + stealth_mode=True) if self.picks[traceID]['epp'] < 0: self.picks[traceID]['epp'] diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index d3a9f1fc..604ea940 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -343,7 +343,7 @@ def reassess_pilot_event(root_dir, event_id, out_dir=None, fn_param=None, verbos default.get('tsnrz' if phase == 'P' else 'tsnrh'), Pick1=rel_pick, iplot=None, - stealthMode=True) + stealth_mode=True) if epp is None or lpp is None: continue epp = stime + epp diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index e603cfa4..09405fb1 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -16,7 +16,7 @@ import numpy as np from obspy.core import Stream, UTCDateTime -def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode=False): +def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealth_mode=False): ''' Function to derive earliest and latest possible pick after Diehl & Kissling (2009) as reasonable uncertainties. Latest possible pick is based on noise level, @@ -45,8 +45,9 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode=False): LPick = None EPick = None PickError = None - if stealthMode is False: - print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...' + if stealth_mode is False: + print('earllatepicker: Get earliest and latest possible pick' + ' relative to most likely pick ...') x = X[0].data t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate, @@ -62,8 +63,9 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode=False): ilup, = np.where(x[isignal] > nlevel) ildown, = np.where(x[isignal] < -nlevel) if not ilup.size and not ildown.size: - print ("earllatepicker: Signal lower than noise level!") - print ("Skip this trace!") + if stealth_mode is False: + print ("earllatepicker: Signal lower than noise level!\n" + "Skip this trace!") return LPick, EPick, PickError il = min(np.min(ilup) if ilup.size else float('inf'), np.min(ildown) if ildown.size else float('inf')) @@ -78,7 +80,7 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode=False): # if EPick stays NaN the signal window size will be doubled while np.isnan(EPick): if count > 0: - if stealthMode is False: + if stealth_mode is False: print("\nearllatepicker: Doubled signal window size %s time(s) " "because of NaN for earliest pick." % count) isigDoubleWinStart = pis[-1] + 1 @@ -87,7 +89,8 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode=False): if (isigDoubleWinStart + len(pis)) < X[0].data.size: pis = np.concatenate((pis, isignalDoubleWin)) else: - print("Could not double signal window. Index out of bounds.") + if stealth_mode is False: + print("Could not double signal window. Index out of bounds.") break count += 1 # determine all zero crossings in signal window (demeaned)