[change] try to merge streams instead of deleting them when they have gaps

This commit is contained in:
2018-08-06 09:02:05 +02:00
parent 5f2848d584
commit a85b79e432
2 changed files with 30 additions and 19 deletions
+13
View File
@@ -869,6 +869,19 @@ def trim_station_components(data, trim_start=True, trim_end=True):
return data
def merge_stream(stream):
gaps = stream.get_gaps()
if gaps:
# list of merged stations (seed_ids)
merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps]
stream.merge()
print('Merged the following stations because of gaps:')
for merged_station in merged:
print(merged_station)
return stream, gaps
def check4gaps(data):
"""
check for gaps in Stream and remove them