[add] plot phase name in pickDlg, also plot network code

This commit is contained in:
Marcel Paffrath 2017-06-30 13:56:59 +02:00
parent 533f7ea353
commit beed46229a
2 changed files with 14 additions and 5 deletions

View File

@ -1589,6 +1589,11 @@ class MainWindow(QMainWindow):
if wfID in plot_dict.keys(): if wfID in plot_dict.keys():
return plot_dict[wfID][0] return plot_dict[wfID][0]
def getNetworkName(self, wfID):
plot_dict = self.getPlotWidget().getPlotDict()
if wfID in plot_dict.keys():
return plot_dict[wfID][2]
def alterPhase(self): def alterPhase(self):
pass pass
@ -1653,13 +1658,14 @@ class MainWindow(QMainWindow):
def pickDialog(self, wfID, nextStation=False): def pickDialog(self, wfID, nextStation=False):
station = self.getStationName(wfID) station = self.getStationName(wfID)
network = self.getNetworkName(wfID)
if not station: if not station:
return return
self.update_status('picking on station {0}'.format(station)) self.update_status('picking on station {0}'.format(station))
data = self.get_data().getWFData() data = self.get_data().getWFData()
pickDlg = PickDlg(self, parameter=self._inputs, pickDlg = PickDlg(self, parameter=self._inputs,
data=data.select(station=station), data=data.select(station=station),
station=station, station=station, network=network,
picks=self.getPicksOnStation(station, 'manual'), picks=self.getPicksOnStation(station, 'manual'),
autopicks=self.getPicksOnStation(station, 'auto')) autopicks=self.getPicksOnStation(station, 'auto'))
pickDlg.nextStation.setChecked(nextStation) pickDlg.nextStation.setChecked(nextStation)

View File

@ -708,7 +708,7 @@ class WaveformWidget(FigureCanvas):
self.draw() self.draw()
def updateTitle(self, text): def updateTitle(self, text):
self.getAxes().set_title(text) self.getAxes().set_title(text, verticalalignment='bottom')
self.draw() self.draw()
def updateWidget(self, xlabel, ylabel, title): def updateWidget(self, xlabel, ylabel, title):
@ -725,7 +725,7 @@ class WaveformWidget(FigureCanvas):
class PickDlg(QDialog): class PickDlg(QDialog):
update_picks = QtCore.Signal(dict) update_picks = QtCore.Signal(dict)
def __init__(self, parent=None, data=None, station=None, picks=None, def __init__(self, parent=None, data=None, station=None, network=None, picks=None,
autopicks=None, rotate=False, parameter=None, embedded=False): autopicks=None, rotate=False, parameter=None, embedded=False):
super(PickDlg, self).__init__(parent) super(PickDlg, self).__init__(parent)
@ -733,6 +733,7 @@ class PickDlg(QDialog):
self.parameter = parameter self.parameter = parameter
self._embedded = embedded self._embedded = embedded
self.station = station self.station = station
self.network = network
self.rotate = rotate self.rotate = rotate
self.components = 'ZNE' self.components = 'ZNE'
self.currentPhase = None self.currentPhase = None
@ -1122,6 +1123,8 @@ class PickDlg(QDialog):
return self.components return self.components
def getStation(self): def getStation(self):
if self.network and self.station:
return self.network+'.'+self.station
return self.station return self.station
def getPlotWidget(self): def getPlotWidget(self):
@ -1219,7 +1222,6 @@ class PickDlg(QDialog):
self.disconnectMotionEvent() self.disconnectMotionEvent()
self.cidpress = self.connectPressEvent(self.setPick) self.cidpress = self.connectPressEvent(self.setPick)
print(self.currentPhase)
if self.currentPhase.startswith('P'): if self.currentPhase.startswith('P'):
self.set_button_color(self.p_button, 'green') self.set_button_color(self.p_button, 'green')
self.setIniPickP(gui_event, wfdata, trace_number) self.setIniPickP(gui_event, wfdata, trace_number)
@ -1476,7 +1478,8 @@ class PickDlg(QDialog):
ax.plot([mpp + spe, mpp + spe], ylims, colors[1]) ax.plot([mpp + spe, mpp + spe], ylims, colors[1])
ax.plot([mpp, mpp], ylims, colors[2], label='{}-Pick'.format(phase)) ax.plot([mpp, mpp], ylims, colors[2], label='{}-Pick'.format(phase))
else: else:
ax.plot([mpp, mpp], ylims, colors[6], label='{}-Pick (NO PICKERROR)'.format(phase)) ax.plot([mpp, mpp], ylims, colors[6], label='{}-Pick (NO PICKERROR)'.format(phase))
ax.text(mpp, ylims[1], phase)
elif picktype == 'auto': elif picktype == 'auto':
ax.plot(mpp, ylims[1], colors[3], ax.plot(mpp, ylims[1], colors[3],