From 2a054f75f53aff118cdf8bd80926d6387a993479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Fri, 19 May 2017 14:25:24 +0200 Subject: [PATCH] autoPyLoT working properly now, incl. getting right event id and data path. --- QtPyLoT.py | 5 ++--- autoPyLoT.py | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 3d1207fd..322f403f 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -1311,13 +1311,12 @@ class MainWindow(QMainWindow): % self.infile) autopick_parameter = self._inputs self.addListItem(str(autopick_parameter)) - ep = self.get_current_event_path().split('/') - eventid = ep[len(ep) - 1] + receventid = self.get_current_event_path() self.thread = AutoPickThread(parent=self, func=autoPyLoT, infile = self.infile, fnames=self.fnames, - eventid=eventid, + eventid=receventid, savepath=self.autosave) self.thread.message.connect(self.addListItem) diff --git a/autoPyLoT.py b/autoPyLoT.py index 2bf916b8..4ef80f44 100755 --- a/autoPyLoT.py +++ b/autoPyLoT.py @@ -140,8 +140,9 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even events = glob.glob(os.path.join(datapath, parameter.get('eventID'))) else: # autoPyLoT was initialized from GUI - events = [os.path.join(datapath, eventid)] - evID = eventid + events = [] + events.append(eventid) + evID = os.path.split(eventid)[-1] locflag = 2 for event in events: @@ -163,6 +164,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even parameter.setParam(eventID=eventID) else: data.setWFData(fnames) + event = events[0] #now = datetime.datetime.now() #evID = '%d%02d%02d%02d%02d' % (now.year, @@ -366,7 +368,7 @@ if __name__ == "__main__": help='''optional, list of data file names''') parser.add_argument('-e', '-E', '--eventid', type=str, action='store', - help='''optional, event ID''') + help='''optional, event path incl. event ID''') # parser.add_argument('-p', '-P', '--plot', action='store', # help='show interactive plots') parser.add_argument('-s', '-S', '--spath', type=str,