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

Update create_empty_trace docstring

parent 29f057db
No related branches found
No related tags found
No related merge requests found
import urllib2
from numpy import full, nan
import numpy
from obspy.core import Stats, Trace
......@@ -54,19 +54,22 @@ def read_url(url):
def create_empty_trace(trace, channel):
"""
Utility to create a trace containing the given numpy array.
Utility to create an empty trace, similar to another trace.
Parameters
----------
stream: obspy.core.stream
trace: obspy.core.Trace
Trace that is source of most metadata, including array length.
channel: String
Channel name for created Trace.
Returns
-------
obspy.core.Trace
Trace a duplicated empty channel.
a Trace object, filled with numpy.nan.
"""
stats = Stats(trace.stats)
stats.channel = channel
count = len(trace.data)
numpy_data = full((count), nan)
numpy_data = numpy.full((count), numpy.nan)
return Trace(numpy_data, stats)
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