From 4beae3bb2b0f0bb32818c5e0ea5633418a926e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 25 Oct 2016 16:21:48 +0200 Subject: [PATCH] Implemented try-except in restitute_data to capture failed instrument correction. Additional output on screen. --- pylot/core/util/dataprocessing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pylot/core/util/dataprocessing.py b/pylot/core/util/dataprocessing.py index 147eaf78..e578226c 100644 --- a/pylot/core/util/dataprocessing.py +++ b/pylot/core/util/dataprocessing.py @@ -254,9 +254,15 @@ def restitute_data(data, invtype, inobj, unit='VEL', force=False): data.remove(tr) continue # apply restitution to data + print("Correcting instrument at station %s" % tr.stats.station) try: if invtype in ['resp', 'dless']: - tr.simulate(**kwargs) + try: + tr.simulate(**kwargs) + except ValueError as e: + vmsg = '{0}'.format(e) + print(vmsg) + else: tr.attach_response(inventory) tr.remove_response(output=unit,