189 Channels shown in wrong order.

This commit is contained in:
Sebastian Wehling-Benatelli 2016-03-18 15:35:12 +01:00
parent 15080f1699
commit b8d680f54f
4 changed files with 15 additions and 5 deletions

View File

@ -535,7 +535,7 @@ class MainWindow(QMainWindow):
comp = self.getComponent()
title = 'section: {0} components'.format(zne_text[comp])
wfst = self.getData().getWFData().select(component=comp)
self.getPlotWidget().plotWFData(wfdata=wfst, title=title)
self.getPlotWidget().plotWFData(wfdata=wfst, title=title, mapping=False)
self.draw()
plotDict = self.getPlotWidget().getPlotDict()
pos = plotDict.keys()

View File

@ -1 +1 @@
848d-dirty
1508-dirty

View File

@ -46,3 +46,7 @@ OUTPUTFORMATS = {'.xml':'QUAKEML',
'.obs':'NLLOC_OBS'}
LOCTOOLS = dict(nll = nll, hsat = hsat, velest = velest)
COMPONENTS_MAPPING = dict(Z = 2, N = 1, E = 0)
COMPONENTS_MAPPING['1'] = 1
COMPONENTS_MAPPING['2'] = 0

View File

@ -25,7 +25,8 @@ from obspy import Stream, UTCDateTime
from pylot.core.read.inputs import FilterOptions
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin,\
getResolutionWindow
from pylot.core.util.defaults import OUTPUTFORMATS, FILTERDEFAULTS, LOCTOOLS
from pylot.core.util.defaults import OUTPUTFORMATS, FILTERDEFAULTS, LOCTOOLS,\
COMPONENTS_MAPPING
from pylot.core.util.utils import prepTimeAxis, getGlobalTimes, scaleWFData, \
demeanTrace, isSorted, findComboBoxIndex
@ -87,13 +88,18 @@ class MPLWidget(FigureCanvas):
self._parent = parent
def plotWFData(self, wfdata, title=None, zoomx=None, zoomy=None,
noiselevel=None, scaleddata=False):
noiselevel=None, scaleddata=False, mapping=True):
self.getAxes().cla()
self.clearPlotDict()
wfstart, wfend = getGlobalTimes(wfdata)
nmax = 0
for n, trace in enumerate(wfdata):
channel = trace.stats.channel
station = trace.stats.station
if mapping:
comp = channel[-1]
n = COMPONENTS_MAPPING[comp]
nmax = n if n > nmax else nmax
msg = 'plotting %s channel of station %s' % (channel, station)
print(msg)
stime = trace.stats.starttime - wfstart
@ -110,7 +116,7 @@ class MPLWidget(FigureCanvas):
ylabel = ''
self.updateWidget(xlabel, ylabel, title)
self.setXLims([0, wfend - wfstart])
self.setYLims([-0.5, n + 0.5])
self.setYLims([-0.5, nmax + 0.5])
if zoomx is not None:
self.setXLims(zoomx)
if zoomy is not None: