autoPyLoT working properly now, incl. getting right event id and data path.

This commit is contained in:
Ludger Küperkoch 2017-05-19 14:25:24 +02:00
parent 5a3b77dc7b
commit 2a054f75f5
2 changed files with 7 additions and 6 deletions

View File

@ -1311,13 +1311,12 @@ class MainWindow(QMainWindow):
% self.infile) % self.infile)
autopick_parameter = self._inputs autopick_parameter = self._inputs
self.addListItem(str(autopick_parameter)) self.addListItem(str(autopick_parameter))
ep = self.get_current_event_path().split('/') receventid = self.get_current_event_path()
eventid = ep[len(ep) - 1]
self.thread = AutoPickThread(parent=self, self.thread = AutoPickThread(parent=self,
func=autoPyLoT, func=autoPyLoT,
infile = self.infile, infile = self.infile,
fnames=self.fnames, fnames=self.fnames,
eventid=eventid, eventid=receventid,
savepath=self.autosave) savepath=self.autosave)
self.thread.message.connect(self.addListItem) self.thread.message.connect(self.addListItem)

View File

@ -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'))) events = glob.glob(os.path.join(datapath, parameter.get('eventID')))
else: else:
# autoPyLoT was initialized from GUI # autoPyLoT was initialized from GUI
events = [os.path.join(datapath, eventid)] events = []
evID = eventid events.append(eventid)
evID = os.path.split(eventid)[-1]
locflag = 2 locflag = 2
for event in events: for event in events:
@ -163,6 +164,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
parameter.setParam(eventID=eventID) parameter.setParam(eventID=eventID)
else: else:
data.setWFData(fnames) data.setWFData(fnames)
event = events[0] event = events[0]
#now = datetime.datetime.now() #now = datetime.datetime.now()
#evID = '%d%02d%02d%02d%02d' % (now.year, #evID = '%d%02d%02d%02d%02d' % (now.year,
@ -366,7 +368,7 @@ if __name__ == "__main__":
help='''optional, list of data file names''') help='''optional, list of data file names''')
parser.add_argument('-e', '-E', '--eventid', type=str, parser.add_argument('-e', '-E', '--eventid', type=str,
action='store', action='store',
help='''optional, event ID''') help='''optional, event path incl. event ID''')
# parser.add_argument('-p', '-P', '--plot', action='store', # parser.add_argument('-p', '-P', '--plot', action='store',
# help='show interactive plots') # help='show interactive plots')
parser.add_argument('-s', '-S', '--spath', type=str, parser.add_argument('-s', '-S', '--spath', type=str,