obspy.core.stream.Stream¶
- class Stream(traces=None)[source]¶
Bases: future.types.newobject.newobject
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__ unicode(string [, encoding[, errors]]) -> object __module__ str(object) -> string __weakref__ list of weak references to the object (if defined) Public Methods
append Append a single Trace object to the current Stream object. attach_response Search for and attach channel response to each trace as trace.stats.response. clear Clear trace list (convenience method). copy Return a deepcopy of the Stream object. count Return the number of Traces in the Stream object. cutout Cut 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 Remove a linear trend from all traces. differentiate Differentiate all traces with respect to time. extend Extend the current Stream object with a list of Trace objects. filter Filter the data of all traces in the Stream. getGaps Determine all trace gaps/overlaps of the Stream object. insert Insert either a single Trace or a list of Traces before index. integrate Integrate all traces with respect to time. interpolate Interpolate all Traces in a Stream. max Get the values of the absolute maximum amplitudes of all traces in the stream. merge Merge ObsPy Trace objects with same IDs. next normalize Normalize all Traces in the Stream. plot Create a waveform plot of the current ObsPy Stream object. pop Remove and return the Trace object specified by index from the Stream. printGaps Print gap/overlap list summary information of the Stream object. remove Remove the first occurrence of the specified Trace object in the remove_response Deconvolve instrument response for all Traces in Stream. resample Resample data in all traces of stream using Fourier method. reverse Reverse the Traces of the Stream object in place. rotate Rotate stream objects. select Return new Stream object only with these traces that match the given simulate Correct for instrument response / Simulate new instrument response. slice Return new Stream object cut to the given start and end time. sort Sort the traces in the Stream object. spectrogram Create a spectrogram plot for each trace in the stream. split Split any trace containing gaps into contiguous unmasked traces. std Calculate standard deviations of all Traces in the Stream. taper Taper all Traces in Stream. trigger Run a triggering algorithm on all traces in the stream. trim Cut all traces of this Stream object to given start and end time. verify Verify all traces of current Stream against available meta data. write Save stream into a file. Private Methods
_cleanup Merge consistent trace objects but leave everything else alone. _ltrim Cut all traces of this Stream object to given start time. _mergeChecks Sanity checks for merging. _repr_pretty_ _rtrim Cut all traces of this Stream object to given end time. Special Methods
__add__ 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__ Add two streams with self += other. __init__ __iter__ Return a robust iterator for stream.traces. __le__ Too ambiguous, throw an Error. __len__ Return the number of Traces in the Stream object. __long__ __lt__ Too ambiguous, throw an Error. __mul__ Create a new Stream containing num copies of this stream. __native__ Hook for the future.utils.native() function __ne__ Implements rich comparison of Stream objects for ”!=” operator. __nonzero__ A Stream is considered zero if has no Traces. __setitem__ __setitem__ method of obspy.Stream objects. __str__ Return short summary string of the current stream. __unicode__