Implemented try-except in restitute_data to capture failed instrument correction. Additional output on screen.

This commit is contained in:
Ludger Küperkoch 2016-10-25 16:21:48 +02:00
parent b11a03af58
commit 4beae3bb2b

View File

@ -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,