Skip to content
Snippets Groups Projects
Commit 99e1322d authored by arigdon-usgs's avatar arigdon-usgs
Browse files

Reset the Timeseries Utility to the master. The changes will be introduced in...

Reset the Timeseries Utility to the master. The changes will be introduced in a separate pull request
parent 75836cb9
No related branches found
No related tags found
No related merge requests found
......@@ -195,36 +195,17 @@ def merge_streams(*streams):
stream with contiguous traces merged, and gaps filled with numpy.nan
"""
merged = obspy.core.Stream()
# masked_trace = None
# add unmasked, split traces to be merged
for stream in streams:
merged += mask_stream(stream)
# if trace is completely masked separate out to be added back in later
# for trace in merged:
# if trace.data.mask.all():
# if not masked_trace:
# masked_trace = trace
# else:
# masked_trace += trace
# split traces that contain gaps
merged = merged.split()
# merge data
merged.merge(
# 1 = do not interpolate
interpolation_samples=1,
# 1 = when there is overlap, use data from trace with last endtime
method=1)
# trim masked trace to the same size as other traces and add back to merged stream
# if masked_trace:
# masked_trace.trim(merged[0].stats.starttime,merged[0].stats.endtime)
# merged += masked_trace
# convert back to NaN filled array
merged = unmask_stream(merged)
return merged
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment