From 76855260218b3248a9ec411b5cd4e659aeb78ff4 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 6 Dec 2019 00:42:19 -0500 Subject: [PATCH] Fix PZ if damping constant is zero (#24) For some stations (e.g. DONET1 stations), the damping constant is always zero, leading to real=0. --- HinetPy/win32.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HinetPy/win32.py b/HinetPy/win32.py index 4f1f0890..4ea9be69 100644 --- a/HinetPy/win32.py +++ b/HinetPy/win32.py @@ -252,7 +252,7 @@ def _get_channels(ctable): lsb_value=float(items[12])) channels.append(channel) except ValueError as e: - logger.warning("Error in parsing channel information for %s.%s (%s). Skipped.", + logger.warning("Error in parsing channel information for %s.%s (%s). Skipped.", items[3], items[4], items[0]) logger.warning("Original error message: %s", e) return channels @@ -417,7 +417,7 @@ def _write_pz(pzfile, real, imaginary, constant): def _extract_sacpz(channel, suffix='SAC_PZ', outdir='.', keep_sensitivity=False): real, imaginary, constant = _channel2pz(channel, keep_sensitivity=keep_sensitivity) - if not real: # something wrong with channel information, skipped + if real == None or imaginary == None or constant == None: # something wrong with channel information, skipped return None pzfile = "{}.{}".format(channel.name, channel.component)