From d2d8498739eadf9c9f22136fb34ec1860f05502c Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Mon, 12 Jun 2017 14:36:38 +0200 Subject: [PATCH] [bugfix] stream oabject overwritten when using alter_comp causing traces to disappear in plot --- pylot/RELEASE-VERSION | 2 +- pylot/core/util/widgets.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 6d6e8843..038cd01d 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -dded-dirty +5412-dirty diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 60257c90..e49f9ca7 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -476,12 +476,14 @@ class WaveformWidgetPG(QtGui.QWidget): alter_comp = compclass.getCompPosition(component) #alter_comp = str(alter_comp[0]) - wfdata = wfdata.select(component=component) - wfdata += wfdata.select(component=alter_comp) - + st_select = wfdata.select(component=component) + st_select += wfdata.select(component=alter_comp) + else: + st_select = wfdata + # list containing tuples of network, station, channel (for sorting) nsc = [] - for trace in wfdata: + for trace in st_select: nsc.append((trace.stats.network, trace.stats.station, trace.stats.channel)) nsc.sort() nsc.reverse() @@ -496,7 +498,7 @@ class WaveformWidgetPG(QtGui.QWidget): print('Warning: Could not set zoom limits') for n, (network, station, channel) in enumerate(nsc): - st = wfdata.select(network=network, station=station, channel=channel) + st = st_select.select(network=network, station=station, channel=channel) trace = st[0] if mapping: comp = channel[-1] @@ -623,18 +625,20 @@ class WaveformWidget(FigureCanvas): alter_comp = compclass.getCompPosition(component) #alter_comp = str(alter_comp[0]) - wfdata = wfdata.select(component=component) - wfdata += wfdata.select(component=alter_comp) + st_select = wfdata.select(component=component) + st_select += wfdata.select(component=alter_comp) + else: + st_select = wfdata # list containing tuples of network, station, channel (for sorting) nsc = [] - for trace in wfdata: + for trace in st_select: nsc.append((trace.stats.network, trace.stats.station, trace.stats.channel)) nsc.sort() nsc.reverse() for n, (network, station, channel) in enumerate(nsc): - st = wfdata.select(network=network, station=station, channel=channel) + st = st_select.select(network=network, station=station, channel=channel) trace = st[0] if mapping: comp = channel[-1]