From 0318fe7c32abb183f7e175d4c6558fd29bad105f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Thu, 27 Oct 2016 16:15:38 +0200 Subject: [PATCH] Bugfix in calcsourcespec: take into account special case of components 1, 2, and Z. --- pylot/core/analysis/magnitude.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index f0c5cff1..6c91c627 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -459,12 +459,14 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence, "no rotation of components possible!") # instead, use component 3 ldat = LQT.select(component="3") + if len(ldat == 0: + # maybe component z available + ldat = LQT.select(component="Z") # 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