Exception for ValueError, if autoPyLoT has been started from terminal.

Raise SacIOError if obspy.read spuriously wants to read SAC data.
This commit is contained in:
Ludger Küperkoch
2017-06-02 11:09:32 +02:00
parent 0fb6e5d4df
commit e2c1b8501e
2 changed files with 21 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import copy
import os
from obspy import read_events
from obspy.core import read, Stream, UTCDateTime
from obspy.io.sac import SacIOError
from obspy.core.event import Event
from pylot.core.io.phases import readPILOTEvent, picks_from_picksdict, \
picksdict_from_pilot, merge_picks
@@ -230,6 +231,8 @@ class Data(object):
self.wfdata += read(fname, format='GSE2')
except Exception as e:
warnmsg += '{0}\n{1}\n'.format(fname, e)
except SacIOError as se:
warnmsg += '{0}\n{1}\n'.format(fname, se)
if warnmsg:
warnmsg = 'WARNING: unable to read\n' + warnmsg
print(warnmsg)