Skip to content
Snippets Groups Projects
Commit 9d0c6ec4 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Add utility method to list channels in a stream

parent b3f9f16d
No related branches found
No related tags found
No related merge requests found
......@@ -110,3 +110,22 @@ def get_merged_gaps(gaps):
if merged_gap is not None:
merged_gaps.append(merged_gap)
return merged_gaps
def get_channels(stream):
"""Get a list of channels in a stream.
Parameters
----------
stream : obspy.core.Stream
Returns
-------
channels : array_like
"""
channels = {}
for trace in stream:
channel = trace.stats.channel
if channel:
channels[channel] = True
return [ch for ch in channels]
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