Implemented try-except in restitute_data to capture failed instrument correction. Additional output on screen.
This commit is contained in:
parent
b11a03af58
commit
4beae3bb2b
@ -254,9 +254,15 @@ def restitute_data(data, invtype, inobj, unit='VEL', force=False):
|
|||||||
data.remove(tr)
|
data.remove(tr)
|
||||||
continue
|
continue
|
||||||
# apply restitution to data
|
# apply restitution to data
|
||||||
|
print("Correcting instrument at station %s" % tr.stats.station)
|
||||||
try:
|
try:
|
||||||
if invtype in ['resp', 'dless']:
|
if invtype in ['resp', 'dless']:
|
||||||
|
try:
|
||||||
tr.simulate(**kwargs)
|
tr.simulate(**kwargs)
|
||||||
|
except ValueError as e:
|
||||||
|
vmsg = '{0}'.format(e)
|
||||||
|
print(vmsg)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
tr.attach_response(inventory)
|
tr.attach_response(inventory)
|
||||||
tr.remove_response(output=unit,
|
tr.remove_response(output=unit,
|
||||||
|
Loading…
Reference in New Issue
Block a user