implied stealth mode to suppress huge amounts of text output

This commit is contained in:
Marcel Paffrath 2015-10-12 12:59:53 +02:00
parent 5bb50d5be4
commit 0adc890aef

View File

@ -14,7 +14,7 @@ from obspy.core import Stream, UTCDateTime
import warnings import warnings
def earllatepicker(X, nfac, TSNR, Pick1, iplot=None): def earllatepicker(X, nfac, TSNR, Pick1, iplot=None, stealthMode = False):
''' '''
Function to derive earliest and latest possible pick after Diehl & Kissling (2009) Function to derive earliest and latest possible pick after Diehl & Kissling (2009)
as reasonable uncertainties. Latest possible pick is based on noise level, as reasonable uncertainties. Latest possible pick is based on noise level,
@ -43,7 +43,8 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
LPick = None LPick = None
EPick = None EPick = None
PickError = None PickError = None
#print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...' if stealthMode is False:
print 'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...'
x = X[0].data x = X[0].data
t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate, t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate,
@ -74,8 +75,9 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None):
# if EPick stays NaN the signal window size will be doubled # if EPick stays NaN the signal window size will be doubled
while np.isnan(EPick): while np.isnan(EPick):
if count > 0: if count > 0:
print("\nearllatepicker: Doubled signal window size %s time(s) " if stealthMode is False:
"because of NaN for earliest pick." %count) print("\nearllatepicker: Doubled signal window size %s time(s) "
"because of NaN for earliest pick." %count)
isigDoubleWinStart = pis[-1] + 1 isigDoubleWinStart = pis[-1] + 1
isignalDoubleWin = np.arange(isigDoubleWinStart, isignalDoubleWin = np.arange(isigDoubleWinStart,
isigDoubleWinStart + len(pis)) isigDoubleWinStart + len(pis))