obspy.core.stream.Stream

class Stream(traces=None)[source]

Bases: object

List like object of multiple ObsPy Trace objects.

Parameters:traces (list of Trace, optional) Initial list of ObsPy Trace objects.

Basic Usage

>>> trace1 = Trace()
>>> trace2 = Trace()
>>> stream = Stream(traces=[trace1, trace2])
>>> print(stream)  
2 Trace(s) in Stream:
...

Supported Operations

stream = streamA + streamB
Merges all traces within the two Stream objects streamA and streamB into the new Stream object stream. See also: Stream.__add__().
stream += streamA
Extends the Stream object stream with all traces from streamA. See also: Stream.__iadd__().
len(stream)
Returns the number of Traces in the Stream object stream. See also: Stream.__len__().
str(stream)
Contains the number of traces in the Stream object and returns the value of each Trace’s __str__ method. See also: Stream.__str__().

Attributes

__dict__
__doc__ str(object) -> string
__module__ str(object) -> string
__weakref__ list of weak references to the object (if defined)

Public Methods

append Appends a single Trace object to the current Stream object.
clear Clear trace list (convenient method).
copy Returns a deepcopy of the Stream object.
count Returns the number of Traces in the Stream object.
cutout Cuts the given time range out of all traces of this Stream object.
decimate Downsample data in all traces of stream by an integer factor.
detrend Method to remove a linear trend from all traces.
differentiate Method to differentiate all traces with respect to time.
extend Extends the current Stream object with a list of Trace objects.
filter Filters the data of all traces in the Stream.
getGaps Returns a list of all trace gaps/overlaps of the Stream object.
insert Inserts either a single Trace or a list of Traces before index.
integrate Method to integrate all traces with respect to time.
max Method to get the values of the absolute maximum amplitudes of all traces in the stream.
merge Merges ObsPy Trace objects with same IDs.
normalize Normalizes all trace in the stream.
plot Creates a waveform plot of the current ObsPy Stream object.
pop Removes the Trace object specified by index from the Stream object and
printGaps Print gap/overlap list summary information of the Stream object.
remove Removes the first occurrence of the specified Trace object in the
resample Resample data in all traces of stream using Fourier method.
reverse Reverses the Traces of the Stream object in place.
rotate Convenience method for rotating stream objects.
select Returns new Stream object only with these traces that match the given
simulate Correct for instrument response / Simulate new instrument response.
slice Returns new Stream object cut to the given start- and endtime.
sort Method to sort the traces in the Stream object.
spectrogram Creates a spectrogram plot for each trace in the stream.
split Splits any trace containing gaps into contiguous unmasked traces.
std Method to get the standard deviations of amplitudes in all trace in the stream.
taper Method to taper all Traces in Stream.
trigger Runs a triggering algorithm on all traces in the stream.
trim Cuts all traces of this Stream object to given start and end time.
verify Verifies all traces of current Stream against available meta data.
write Saves stream into a file.

Private Methods

_cleanup Merge consistent trace objects but leave everything else alone.
_ltrim Cuts all traces of this Stream object to given start time.
_mergeChecks Sanity checks for merging.
_rtrim Cuts all traces of this Stream object to given end time.

Special Methods

__add__ Method to add two streams or a stream with a single trace.
__delitem__ Passes on the __delitem__ method to the underlying list of traces.
__eq__ Implements rich comparison of Stream objects for “==” operator.
__ge__ Too ambiguous, throw an Error.
__getitem__ __getitem__ method of obspy.Stream objects.
__getslice__ __getslice__ method of obspy.Stream objects.
__gt__ Too ambiguous, throw an Error.
__iadd__ Method to add two streams with self += other.
__init__
__iter__ Return a robust iterator for stream.traces.
__le__ Too ambiguous, throw an Error.
__len__ Returns the number of Traces in the Stream object.
__lt__ Too ambiguous, throw an Error.
__mul__ Creates a new Stream containing num copies of this stream.
__ne__ Implements rich comparison of Stream objects for ”!=” operator.
__setitem__ __setitem__ method of obspy.Stream objects.
__str__ Returns short summary string of the current stream.

This Page