added map_projection plot
This commit is contained in:
@@ -1 +1 @@
|
||||
6287-dirty
|
||||
fd70-dirty
|
||||
|
||||
@@ -63,7 +63,7 @@ class map_projection(QtGui.QWidget):
|
||||
print('Could not generate Plot for station {st}.\n{er}'.format(st=station, er=e))
|
||||
|
||||
def connectSignals(self):
|
||||
self.combobox.currentIndexChanged.connect(self.refresh_drawings)
|
||||
self.comboBox_phase.currentIndexChanged.connect(self.refresh_drawings)
|
||||
|
||||
def init_graphics(self):
|
||||
self.main_box = QtGui.QVBoxLayout()
|
||||
@@ -72,11 +72,11 @@ class map_projection(QtGui.QWidget):
|
||||
self.top_row = QtGui.QHBoxLayout()
|
||||
self.main_box.addLayout(self.top_row)
|
||||
|
||||
self.combobox = QtGui.QComboBox()
|
||||
self.combobox.insertItem(0, 'P')
|
||||
self.combobox.insertItem(1, 'S')
|
||||
self.comboBox_phase = QtGui.QComboBox()
|
||||
self.comboBox_phase.insertItem(0, 'P')
|
||||
self.comboBox_phase.insertItem(1, 'S')
|
||||
self.top_row.addWidget(QtGui.QLabel('Select a phase: '))
|
||||
self.top_row.addWidget(self.combobox)
|
||||
self.top_row.addWidget(self.comboBox_phase)
|
||||
|
||||
if not self.figure:
|
||||
fig = plt.figure()
|
||||
@@ -108,7 +108,7 @@ class map_projection(QtGui.QWidget):
|
||||
self.lon = lon
|
||||
|
||||
def init_picks(self):
|
||||
phase = self.combobox.currentText()
|
||||
phase = self.comboBox_phase.currentText()
|
||||
def get_picks(station_names):
|
||||
picks=[]
|
||||
for station in station_names:
|
||||
@@ -240,6 +240,9 @@ class map_projection(QtGui.QWidget):
|
||||
if self.picked:
|
||||
self.scatter_picked_stations()
|
||||
self.cbar = self.add_cbar(label='Time relative to first onset [s]')
|
||||
self.comboBox_phase.setEnabled(True)
|
||||
else:
|
||||
self.comboBox_phase.setEnabled(False)
|
||||
self.annotate_ax()
|
||||
self.canvas.draw()
|
||||
|
||||
|
||||
@@ -39,16 +39,20 @@ class AutoPickThread(QThread):
|
||||
|
||||
|
||||
class Thread(QThread):
|
||||
def __init__(self, parent, func, progressText = None):
|
||||
def __init__(self, parent, func, arg=None, progressText=None):
|
||||
QThread.__init__(self, parent)
|
||||
self.func = func
|
||||
self.arg = arg
|
||||
self.progressText = progressText
|
||||
self.pbdlg = None
|
||||
self.finished.connect(self.hideProgressbar)
|
||||
self.showProgressbar()
|
||||
|
||||
def run(self):
|
||||
self.func()
|
||||
if self.arg:
|
||||
self.data = self.func(self.arg)
|
||||
else:
|
||||
self.data = self.func()
|
||||
|
||||
def __del__(self):
|
||||
self.wait()
|
||||
@@ -63,8 +67,7 @@ class Thread(QThread):
|
||||
vl.addWidget(pb)
|
||||
vl.addWidget(QLabel(self.progressText))
|
||||
self.pbdlg.setLayout(vl)
|
||||
self.pbdlg.show()
|
||||
self.pbdlg.setWindowFlags(Qt.FramelessWindowHint)
|
||||
self.pbdlg.setWindowFlags(Qt.SplashScreen)
|
||||
self.pbdlg.show()
|
||||
|
||||
def hideProgressbar(self):
|
||||
|
||||
@@ -397,7 +397,7 @@ class WaveformWidget(FigureCanvas):
|
||||
self.setParent(parent)
|
||||
self.figure = Figure()
|
||||
self.figure.set_facecolor((.92, .92, .92))
|
||||
# attribute plotdict is an dictionary connecting position and a name
|
||||
# attribute plotdict is a dictionary connecting position and a name
|
||||
self.plotdict = dict()
|
||||
# create axes
|
||||
self.axes = self.figure.add_subplot(111)
|
||||
|
||||
Reference in New Issue
Block a user