restituteWFData: introduced return flag restflag to indicate whether restitution could be performed or not.

This commit is contained in:
Ludger Küperkoch 2015-09-04 11:12:25 +02:00
parent ab1d27747a
commit 0dc1091078

View File

@ -228,6 +228,9 @@ class Data(object):
:param streams: :param streams:
:return: :return:
""" """
restflag = 0
if streams is None: if streams is None:
st_raw = self.getWFData() st_raw = self.getWFData()
st = st_raw.copy() st = st_raw.copy()
@ -236,7 +239,7 @@ class Data(object):
for tr in st: for tr in st:
# remove underscores # remove underscores
if tr.stats.station[3] == '_': if len(tr.stats.station) > 3 and tr.stats.station[3] == '_':
tr.stats.station = tr.stats.station[0:3] tr.stats.station = tr.stats.station[0:3]
dlp = '%s/*.dless' % invdlpath dlp = '%s/*.dless' % invdlpath
invp = '%s/*.xml' % invdlpath invp = '%s/*.xml' % invdlpath
@ -273,6 +276,7 @@ class Data(object):
'date': st[ 'date': st[
i].stats.starttime, i].stats.starttime,
'units': "VEL"}) 'units': "VEL"})
restflag = 1
except ValueError as e: except ValueError as e:
vmsg = '{0}'.format(e) vmsg = '{0}'.format(e)
print(vmsg) print(vmsg)
@ -303,6 +307,7 @@ class Data(object):
st[i].attach_response(inv) st[i].attach_response(inv)
st[i].remove_response(output='VEL', st[i].remove_response(output='VEL',
pre_filt=prefilt) pre_filt=prefilt)
restflag = 1
except ValueError as e: except ValueError as e:
vmsg = '{0}'.format(e) vmsg = '{0}'.format(e)
print(vmsg) print(vmsg)
@ -334,6 +339,7 @@ class Data(object):
'units': "VEL"} 'units': "VEL"}
st[i].simulate(paz_remove=None, pre_filt=prefilt, st[i].simulate(paz_remove=None, pre_filt=prefilt,
seedresp=seedresp) seedresp=seedresp)
restflag = 1
except ValueError as e: except ValueError as e:
vmsg = '{0}'.format(e) vmsg = '{0}'.format(e)
print(vmsg) print(vmsg)
@ -346,7 +352,7 @@ class Data(object):
print("Go on processing data without source parameter " print("Go on processing data without source parameter "
"determination!") "determination!")
return st return st, restflag
def getEvtData(self): def getEvtData(self):
""" """