From 5e6d2e7211135edd34f4d10de7530c5edb0296b3 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Fri, 30 Nov 2018 09:42:22 +0100 Subject: [PATCH] [Bugfix] Merge traces treating overlaps as data instead of gaps Could not open the Pickwindow on some stations. Gaps were merged so that overlapping values were marked as gaps, which lead to an error when those traces were processed. Method 1 takes data from traces instead, see https://docs.obspy.org/packages/autogen/obspy.core.trace.Trace.__add__.html --- pylot/core/util/utils.py | 2 +- pylot/core/util/widgets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index 5f4313f9..463e76f4 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -870,7 +870,7 @@ def merge_stream(stream): if gaps: # list of merged stations (seed_ids) merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps] - stream.merge() + stream.merge(method=1) print('Merged the following stations because of gaps:') for merged_station in merged: print(merged_station) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 97a8a398..9cae2b04 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1233,7 +1233,7 @@ class PylotCanvas(FigureCanvas): gaps = st_select.get_gaps() if gaps: merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps] - st_select.merge() + st_select.merge(method=1) print('Merged the following stations because of gaps:') for merged_station in merged: print(merged_station)