[removed] check4gaps/doubled, plotting merged instead
This commit is contained in:
parent
a876384338
commit
4d3b300e17
9
PyLoT.py
9
PyLoT.py
@ -1753,13 +1753,14 @@ class MainWindow(QMainWindow):
|
||||
|
||||
def finish_pg_plot(self):
|
||||
self.getPlotWidget().updateWidget()
|
||||
plots = self.wfp_thread.data
|
||||
plots, gaps = self.wfp_thread.data
|
||||
for times, data, times_syn, data_syn in plots:
|
||||
self.dataPlot.plotWidget.getPlotItem().plot(times, data,
|
||||
pen=self.dataPlot.pen_linecolor)
|
||||
if len(data_syn) > 0:
|
||||
self.dataPlot.plotWidget.getPlotItem().plot(times_syn, data_syn,
|
||||
pen=self.dataPlot.pen_linecolor_syn)
|
||||
|
||||
self.dataPlot.reinitMoveProxy()
|
||||
self.dataPlot.plotWidget.showAxis('left')
|
||||
self.dataPlot.plotWidget.showAxis('bottom')
|
||||
@ -1900,9 +1901,9 @@ class MainWindow(QMainWindow):
|
||||
self.plot_method = 'fast'
|
||||
else:
|
||||
self.plot_method = 'normal'
|
||||
plots = plotWidget.plotWFData(wfdata=wfst, wfsyn=wfsyn, title=title, mapping=False, component=comp,
|
||||
nth_sample=int(nth_sample), method=self.plot_method)
|
||||
return plots
|
||||
plots, gaps = plotWidget.plotWFData(wfdata=wfst, wfsyn=wfsyn, title=title, mapping=False, component=comp,
|
||||
nth_sample=int(nth_sample), method=self.plot_method)
|
||||
return plots, gaps
|
||||
|
||||
def adjustPlotHeight(self):
|
||||
if self.pg:
|
||||
|
@ -398,9 +398,6 @@ class Data(object):
|
||||
# various pre-processing steps:
|
||||
# remove possible underscores in station names
|
||||
self.wfdata = remove_underscores(self.wfdata)
|
||||
# check for gaps and doubled channels
|
||||
check4gaps(self.wfdata)
|
||||
check4doubled(self.wfdata)
|
||||
# check for stations with rotated components
|
||||
if checkRotated and metadata is not None:
|
||||
self.wfdata = check4rotated(self.wfdata, metadata, verbosity=0)
|
||||
|
@ -464,6 +464,7 @@ class WaveformWidgetPG(QtGui.QWidget):
|
||||
self.wfstart, self.wfend = 0, 0
|
||||
self.pen_multicursor = self.pg.mkPen(self.parent()._style['multicursor']['rgba'])
|
||||
self.pen_linecolor = self.pg.mkPen(self.parent()._style['linecolor']['rgba'])
|
||||
self.pen_linecolor_highlight = self.pg.mkPen((255, 100, 100, 255))
|
||||
self.pen_linecolor_syn = self.pg.mkPen((100, 0, 255, 255))
|
||||
self.reinitMoveProxy()
|
||||
self._proxy = self.pg.SignalProxy(self.plotWidget.scene().sigMouseMoved, rateLimit=60, slot=self.mouseMoved)
|
||||
@ -529,6 +530,14 @@ class WaveformWidgetPG(QtGui.QWidget):
|
||||
else:
|
||||
st_select = wfdata
|
||||
|
||||
gaps = st_select.get_gaps()
|
||||
if gaps:
|
||||
merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps]
|
||||
st_select.merge()
|
||||
print('Merged the following stations because of gaps:')
|
||||
for merged_station in merged:
|
||||
print(merged_station)
|
||||
|
||||
# list containing tuples of network, station, channel (for sorting)
|
||||
nsc = []
|
||||
for trace in st_select:
|
||||
@ -590,7 +599,7 @@ class WaveformWidgetPG(QtGui.QWidget):
|
||||
self.ylabel = ''
|
||||
self.setXLims([0, self.wfend - self.wfstart])
|
||||
self.setYLims([0.5, nmax + 0.5])
|
||||
return plots
|
||||
return plots, gaps
|
||||
|
||||
def minMax(self, trace, time_ax):
|
||||
'''
|
||||
@ -1013,6 +1022,14 @@ class PylotCanvas(FigureCanvas):
|
||||
if mapping:
|
||||
plot_positions = self.calcPlotPositions(st_select, compclass)
|
||||
|
||||
gaps = st_select.get_gaps()
|
||||
if gaps:
|
||||
merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps]
|
||||
st_select.merge()
|
||||
print('Merged the following stations because of gaps:')
|
||||
for merged_station in merged:
|
||||
print(merged_station)
|
||||
|
||||
# list containing tuples of network, station, channel and plot position (for sorting)
|
||||
nsc = []
|
||||
for plot_pos, trace in enumerate(st_select):
|
||||
|
Loading…
Reference in New Issue
Block a user