From dc281c6c0e9b3a9611e58324d0f237660bdc8a9f Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Tue, 23 Jun 2015 08:24:21 +0200 Subject: [PATCH] [bugfix] determine the SNR according to the demeaned waveform between the beginning of the noise window and the end of the signal window --- pylot/core/pick/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index 97daa194..d74ab2a6 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -322,6 +322,9 @@ def getSNR(X, TSNR, t1): print 'getSNR: Empty array isignal, check signal window!' return + # demean over entire snr window + x -= x[inoise[0][0]:isignal[0][-1]].mean() + # calculate ratios noiselevel = np.sqrt(np.mean(np.square(x[inoise]))) signallevel = np.sqrt(np.mean(np.square(x[isignal])))