From d360d9db928deac322739cf4d742f2d764a90f2c Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 12 Jul 2018 14:13:34 +0200 Subject: [PATCH] [bugfix] raise Exception if no Z-component is found for Magnitude calculation --- pylot/core/analysis/magnitude.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index 08704f7b..cd1fe257 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -510,6 +510,9 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence, zdat = select_for_phase(wfstream, "P") + if len(zdat) == 0: + raise IOError('No vertical component found in stream:\n{}'.format(wfstream)) + dt = zdat[0].stats.delta freq = zdat[0].stats.sampling_rate