From 41eebfbcda4fda2f47b807370c8d02930e581f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Thu, 27 Oct 2016 15:50:24 +0200 Subject: [PATCH] Bugfix in calcsourcespec: If no rotation of traces is possible, use component 3 instead of component z. --- pylot/core/analysis/magnitude.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index 856ece8a..d0fdbac1 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -451,19 +451,20 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence, LQT = wfstream.rotate('ZNE->LQT', azimuth, incidence) ldat = LQT.select(component="L") if len(ldat) == 0: - # if horizontal channels are 2 and 3 + # if horizontal channels are 1 and 2 # no azimuth information is available and thus no # rotation is possible! if verbosity: print("calcsourcespec: Azimuth information is missing, " "no rotation of components possible!") - ldat = LQT.select(component="Z") + # instead, use component 3 + ldat = LQT.select(component="3") # integrate to displacement # unrotated vertical component (for comparison) inttrz = signal.detrend(integrate.cumtrapz(zdat[0].data, None, dt)) - # rotated component Z => L + print ldat Ldat = signal.detrend(integrate.cumtrapz(ldat[0].data, None, dt)) # get window after P pulse for