Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop

Merge necessary after commit before pull.
This commit is contained in:
Ludger Küperkoch 2015-06-23 12:02:51 +02:00
commit c35dd456fe

View File

@ -324,6 +324,9 @@ def getSNR(X, TSNR, t1):
print 'getSNR: Empty array isignal, check signal window!' print 'getSNR: Empty array isignal, check signal window!'
return return
# demean over entire snr window
x -= x[inoise[0]:isignal[-1]].mean()
# calculate ratios # calculate ratios
noiselevel = np.sqrt(np.mean(np.square(x[inoise]))) noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
signallevel = np.sqrt(np.mean(np.square(x[isignal]))) signallevel = np.sqrt(np.mean(np.square(x[isignal])))
@ -352,9 +355,8 @@ def getnoisewin(t, t1, tnoise, tgap):
:type: float :type: float
''' '''
inoise = None
# get noise window # get noise window
inoise = np.where((t <= max([t1 - tgap, 0])) \ inoise, = np.where((t <= max([t1 - tgap, 0])) \
& (t >= max([t1 - tnoise - tgap, 0]))) & (t >= max([t1 - tnoise - tgap, 0])))
if np.size(inoise) < 1: if np.size(inoise) < 1:
print 'getnoisewin: Empty array inoise, check noise window!' print 'getnoisewin: Empty array inoise, check noise window!'
@ -377,9 +379,8 @@ def getsignalwin(t, t1, tsignal):
:type: float :type: float
''' '''
inoise = None
# get signal window # get signal window
isignal = np.where((t <= min([t1 + tsignal, len(t)])) \ isignal, = np.where((t <= min([t1 + tsignal, len(t)])) \
& (t >= t1)) & (t >= t1))
if np.size(isignal) < 1: if np.size(isignal) < 1:
print 'getsignalwin: Empty array isignal, check signal window!' print 'getsignalwin: Empty array isignal, check signal window!'