[bugfix] gaps are now merged when data are loaded and not when plotting (could cause problems with data object being empty)
This commit is contained in:
1 parent
15882ed27e
commit
c1cb0e4a37
12 files changed
+5194
-12
No files matched your search
@@ -878,7 +878,7 @@ def merge_stream(stream):
|
||||
return stream, gaps
|
||||
|
||||
|
||||
def check4gaps(data):
|
||||
def check4gapsAndRemove(data):
|
||||
"""
|
||||
check for gaps in Stream and remove them
|
||||
:param data: stream of seismic data
|
||||
@@ -898,6 +898,25 @@ def check4gaps(data):
|
||||
return data
|
||||
|
||||
|
||||
def check4gapsAndMerge(data):
|
||||
"""
|
||||
check for gaps in Stream and merge if gaps are found
|
||||
:param data: stream of seismic data
|
||||
:type data: `~obspy.core.stream.Stream`
|
||||
:return: data stream
|
||||
:rtype: `~obspy.core.stream.Stream`
|
||||
"""
|
||||
gaps = data.get_gaps()
|
||||
if gaps:
|
||||
merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps]
|
||||
data.merge(method=1)
|
||||
print('Merged the following stations because of gaps:')
|
||||
for merged_station in merged:
|
||||
print(merged_station)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def check4doubled(data):
|
||||
"""
|
||||
check for doubled stations for same channel in Stream and take only the first one
|
||||
|
||||
@@ -1312,14 +1312,6 @@ 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(method=1)
|
||||
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)
|
||||
nslc = []
|
||||
for plot_pos, trace in enumerate(st_select):
|
||||
|
||||
Reference in new issue
Block a user