From 728cf15f19ac9cc70729a4dc0bd441127cd1c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Wed, 24 Jun 2015 09:29:59 +0200 Subject: [PATCH] Demean: Mean to be subtracted from time series is now calculated from noise part only. --- pylot/core/pick/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index 58fd99a2..971ab1fb 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -47,14 +47,11 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=None): x = X[0].data t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate, X[0].stats.delta) - # get latest possible pick - # get noise window inoise = getnoisewin(t, Pick1, TSNR[0], TSNR[1]) # get signal window isignal = getsignalwin(t, Pick1, TSNR[2]) # remove mean - meanwin = np.hstack((inoise, isignal)) - x = x - np.mean(x[meanwin]) + x = x - np.mean(x[inoise]) # calculate noise level nlevel = np.sqrt(np.mean(np.square(x[inoise]))) * nfac # get time where signal exceeds nlevel @@ -337,7 +334,7 @@ def getSNR(X, TSNR, t1): return # demean over entire snr window - x -= x[inoise[0]:isignal[-1]].mean() + x = x - np.mean(x[np.hstack([inoise, isignal])]) # calculate ratios noiselevel = np.sqrt(np.mean(np.square(x[inoise])))