[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user