[bugfix] events not properly provided to autoPyLoT by TuneAutopicker, wrong parameter name in plotting routine

This commit is contained in:
Marcel Paffrath 2017-06-20 14:32:21 +02:00
parent 0be5c4b694
commit ab979e9b10
4 changed files with 33 additions and 17 deletions

View File

@ -130,12 +130,14 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
print("!!No source parameter estimation possible!!")
print(" !!! ")
if not input_dict:
# started in production mode
datapath = datastructure.expandDataPath()
if fnames == 'None' and not parameter.hasParam('eventID'):
if fnames == 'None' and not parameter['eventID']:
# multiple event processing
# read each event in database
events = [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)]
elif fnames == 'None' and parameter.hasParam('eventID'):
elif fnames == 'None' and parameter['eventID']:
# single event processing
events = glob.glob(os.path.join(datapath, parameter.get('eventID')))
else:
@ -144,6 +146,18 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
events.append(eventid)
evID = os.path.split(eventid)[-1]
locflag = 2
else:
# started in tune mode
datapath = os.path.join(parameter['rootpath'],
parameter['datapath'])
events = []
events.append(os.path.join(datapath,
parameter['database'],
parameter['eventID']))
if not events:
print('autoPyLoT: No events given. Return!')
return
for event in events:
if fnames == 'None':

View File

@ -1 +1 @@
a8544-dirty
0be5-dirty

View File

@ -239,8 +239,8 @@ class AICPicker(AutoPicker):
fig = self.fig
ax = fig.add_subplot(111)
x = self.Data[0].data
ax.plot(self.Tcf, x / max(x), 'k', legend='(HOS-/AR-) Data')
ax.plot(self.Tcf, aicsmooth / max(aicsmooth), 'r', legend='Smoothed AIC-CF')
ax.plot(self.Tcf, x / max(x), 'k', label='(HOS-/AR-) Data')
ax.plot(self.Tcf, aicsmooth / max(aicsmooth), 'r', label='Smoothed AIC-CF')
ax.legend()
ax.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
ax.set_yticks([])

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import sys
import sys, os
from PySide.QtCore import QThread, Signal, Qt
from PySide.QtGui import QDialog, QProgressBar, QLabel, QHBoxLayout
@ -64,7 +64,9 @@ class Thread(QThread):
except Exception as e:
self._executed = False
self._executedError = e
print(e)
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
print('Exception: {}, file: {}, line: {}'.format(exc_type, fname, exc_tb.tb_lineno))
sys.stdout = sys.__stdout__
def __del__(self):