From 0dc10910784bd48378cac7aa5b612d107fa65846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Fri, 4 Sep 2015 11:12:25 +0200 Subject: [PATCH] restituteWFData: introduced return flag restflag to indicate whether restitution could be performed or not. --- pylot/core/read/data.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 30f82c36..ca50132d 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -228,6 +228,9 @@ class Data(object): :param streams: :return: """ + + restflag = 0 + if streams is None: st_raw = self.getWFData() st = st_raw.copy() @@ -236,7 +239,7 @@ class Data(object): for tr in st: # 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] dlp = '%s/*.dless' % invdlpath invp = '%s/*.xml' % invdlpath @@ -273,6 +276,7 @@ class Data(object): 'date': st[ i].stats.starttime, 'units': "VEL"}) + restflag = 1 except ValueError as e: vmsg = '{0}'.format(e) print(vmsg) @@ -303,6 +307,7 @@ class Data(object): st[i].attach_response(inv) st[i].remove_response(output='VEL', pre_filt=prefilt) + restflag = 1 except ValueError as e: vmsg = '{0}'.format(e) print(vmsg) @@ -334,6 +339,7 @@ class Data(object): 'units': "VEL"} st[i].simulate(paz_remove=None, pre_filt=prefilt, seedresp=seedresp) + restflag = 1 except ValueError as e: vmsg = '{0}'.format(e) print(vmsg) @@ -346,7 +352,7 @@ class Data(object): print("Go on processing data without source parameter " "determination!") - return st + return st, restflag def getEvtData(self): """