added station list to TuneAutopicker
This commit is contained in:
parent
4d9c7b02cf
commit
a2ab98c202
42
QtPyLoT.py
42
QtPyLoT.py
@ -556,19 +556,6 @@ class MainWindow(QMainWindow):
|
|||||||
self.drawPicks(picktype=type)
|
self.drawPicks(picktype=type)
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
def getCurrentEvent(self, eventlist=None):
|
|
||||||
if not eventlist:
|
|
||||||
eventlist = self.project.eventlist
|
|
||||||
for event in eventlist:
|
|
||||||
if event.path == self.getCurrentEventPath(eventlist):
|
|
||||||
return event
|
|
||||||
|
|
||||||
def getCurrentEventPath(self, eventlist=None):
|
|
||||||
return str(self.eventBox.currentText().split('|')[0]).strip()
|
|
||||||
|
|
||||||
def getLastEvent(self):
|
|
||||||
return self.recentfiles[0]
|
|
||||||
|
|
||||||
def add_recentfile(self, event):
|
def add_recentfile(self, event):
|
||||||
self.recentfiles.insert(0, event)
|
self.recentfiles.insert(0, event)
|
||||||
|
|
||||||
@ -606,16 +593,28 @@ class MainWindow(QMainWindow):
|
|||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
def getWFFnames_from_eventlist(self, eventlist=None):
|
def getWFFnames_from_eventbox(self, eventlist=None, eventbox=None):
|
||||||
if self.dataStructure:
|
if self.dataStructure:
|
||||||
searchPath = self.dataStructure.expandDataPath()
|
directory = self.getCurrentEventPath(eventbox)
|
||||||
directory = self.getCurrentEventPath(eventlist)
|
fnames = [os.path.join(directory, f) for f in os.listdir(directory)]
|
||||||
self.fnames = [os.path.join(directory, f) for f in os.listdir(directory)]
|
|
||||||
else:
|
else:
|
||||||
raise DatastructureError('not specified')
|
raise DatastructureError('not specified')
|
||||||
if not self.fnames:
|
return fnames
|
||||||
return None
|
|
||||||
return self.fnames
|
def getCurrentEvent(self, eventlist=None, eventbox=None):
|
||||||
|
if not eventlist:
|
||||||
|
eventlist = self.project.eventlist
|
||||||
|
for event in eventlist:
|
||||||
|
if event.path == self.getCurrentEventPath(eventbox):
|
||||||
|
return event
|
||||||
|
|
||||||
|
def getCurrentEventPath(self, eventbox=None):
|
||||||
|
if not eventbox:
|
||||||
|
eventbox = self.eventBox
|
||||||
|
return str(eventbox.currentText().split('|')[0]).strip()
|
||||||
|
|
||||||
|
def getLastEvent(self):
|
||||||
|
return self.recentfiles[0]
|
||||||
|
|
||||||
def add_events(self):
|
def add_events(self):
|
||||||
if not self.project:
|
if not self.project:
|
||||||
@ -942,7 +941,8 @@ class MainWindow(QMainWindow):
|
|||||||
# ans = self.data.setWFData(self.getWFFnames())
|
# ans = self.data.setWFData(self.getWFFnames())
|
||||||
# else:
|
# else:
|
||||||
# ans = False
|
# ans = False
|
||||||
self.data.setWFData(self.getWFFnames_from_eventlist(self.project.eventlist))
|
self.fnames = self.getWFFnames_from_eventbox(self.project.eventlist)
|
||||||
|
self.data.setWFData(self.fnames)
|
||||||
self._stime = full_range(self.get_data().getWFData())[0]
|
self._stime = full_range(self.get_data().getWFData())[0]
|
||||||
|
|
||||||
def connectWFplotEvents(self):
|
def connectWFplotEvents(self):
|
||||||
|
@ -1 +1 @@
|
|||||||
77b07-dirty
|
4d9c-dirty
|
||||||
|
@ -30,6 +30,7 @@ from PySide.QtGui import QAction, QApplication, QCheckBox, QComboBox, \
|
|||||||
from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
|
from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
|
||||||
from PySide.QtWebKit import QWebView
|
from PySide.QtWebKit import QWebView
|
||||||
from obspy import Stream, UTCDateTime
|
from obspy import Stream, UTCDateTime
|
||||||
|
from pylot.core.io.data import Data
|
||||||
from pylot.core.io.inputs import FilterOptions, AutoPickParameter
|
from pylot.core.io.inputs import FilterOptions, AutoPickParameter
|
||||||
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \
|
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \
|
||||||
getResolutionWindow
|
getResolutionWindow
|
||||||
@ -1272,14 +1273,21 @@ class PickDlg(QDialog):
|
|||||||
|
|
||||||
class TuneAutopicker(QWidget):
|
class TuneAutopicker(QWidget):
|
||||||
update = QtCore.Signal(str)
|
update = QtCore.Signal(str)
|
||||||
|
'''
|
||||||
|
QWidget used to modifiy and test picking parameters for autopicking algorithm.
|
||||||
|
|
||||||
|
:param: parent
|
||||||
|
:type: QtPyLoT Mainwindow
|
||||||
|
'''
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QtGui.QWidget.__init__(self, parent, 1)
|
QtGui.QWidget.__init__(self, parent, 1)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.ap = parent._inputs
|
self.ap = parent._inputs
|
||||||
self.fig_dict = parent.fig_dict
|
self.fig_dict = parent.fig_dict
|
||||||
|
self.data = Data()
|
||||||
self.init_main_layouts()
|
self.init_main_layouts()
|
||||||
self.init_eventlist()
|
self.init_eventlist()
|
||||||
|
self.init_stationlist()
|
||||||
self.init_figure_tabs()
|
self.init_figure_tabs()
|
||||||
self.add_parameter()
|
self.add_parameter()
|
||||||
self.add_buttons()
|
self.add_buttons()
|
||||||
@ -1302,9 +1310,23 @@ class TuneAutopicker(QWidget):
|
|||||||
self.eventBox = self.parent.createEventBox()
|
self.eventBox = self.parent.createEventBox()
|
||||||
self.fill_eventbox()
|
self.fill_eventbox()
|
||||||
self.trace_layout.addWidget(self.eventBox)
|
self.trace_layout.addWidget(self.eventBox)
|
||||||
|
self.eventBox.activated.connect(self.fill_stationbox)
|
||||||
|
|
||||||
def init_stationlist(self):
|
def init_stationlist(self):
|
||||||
pass
|
self.stationBox = QtGui.QComboBox()
|
||||||
|
self.trace_layout.addWidget(self.stationBox)
|
||||||
|
|
||||||
|
def fill_stationbox(self):
|
||||||
|
fnames = self.parent.getWFFnames_from_eventbox(eventbox=self.eventBox)
|
||||||
|
self.data.setWFData(fnames)
|
||||||
|
self.stationBox.clear()
|
||||||
|
stations = []
|
||||||
|
for trace in self.data.getWFData():
|
||||||
|
station = trace.stats.station
|
||||||
|
if not station in stations:
|
||||||
|
stations.append(str(station))
|
||||||
|
for station in stations:
|
||||||
|
self.stationBox.addItem(str(station))
|
||||||
|
|
||||||
def init_figure_tabs(self):
|
def init_figure_tabs(self):
|
||||||
self.main_tabs = QtGui.QTabWidget()
|
self.main_tabs = QtGui.QTabWidget()
|
||||||
|
Loading…
Reference in New Issue
Block a user