obspy.core.trace.Trace¶
-
class
Trace
(data=array([], dtype=float64), header=None)[source]¶ Bases:
object
An object containing data of a continuous series, such as a seismic trace.
- Parameters
data (
ndarray
orMaskedArray
) – Array of data samplesheader (dict or
Stats
) – Dictionary containing header fields
- Variables
id – A SEED compatible identifier of the trace.
stats – A container
Stats
for additional header information of the trace.data – Data samples in a
ndarray
orMaskedArray
Note
The
.data
attribute containing the time series samples as anumpy.ndarray
will always be made contiguous in memory. This way it is always safe to use.data
in routines that internally pass the array to C code. On the other hand this might result in some unwanted copying of data in memory. Experts can opt-out by settingTrace._always_contiguous = False
, in this case the user has to make sure themselves that no C operations are performed on potentially incontiguous data.Supported Operations
trace = traceA + traceB
Merges traceA and traceB into one new trace object. See also:
Trace.__add__()
.len(trace)
Returns the number of samples contained in the trace. That is it es equal to
len(trace.data)
. See also:Trace.__len__()
.str(trace)
Returns basic information about the trace object. See also:
Trace.__str__()
.
Attributes
__dict__
__doc__
__hash__
__module__
__weakref__
list of weak references to the object (if defined)
id
Return a SEED compatible identifier of the trace.
meta
Public Methods
Search for and attach channel response to the trace as
Trace
.stats.response.Returns a deepcopy of the trace.
Return number of data samples of the current trace.
Downsample trace data by an integer factor.
Remove a trend from the trace.
Differentiate the trace with respect to time.
Filter the data of the current trace.
Return a SEED compatible identifier of the trace.
Integrate the trace with respect to time.
Interpolate the data using various interpolation techniques.
Returns the value of the absolute maximum amplitude in the trace.
Normalize the trace to its absolute maximum.
Create a simple graph of the current trace.
Deconvolve instrument response.
Remove instrument sensitivity.
Resample trace data using Fourier method.
Correct for instrument response / Simulate new instrument response.
Return a new Trace object with data going from start to end time.
Generator yielding equal length sliding windows of the Trace.
Create a spectrogram plot of the trace.
Split Trace object containing gaps using a NumPy masked array into several traces.
Method to get the standard deviation of amplitudes in the trace.
Taper the trace.
For convenient plotting compute a NumPy array with timing information of all samples in the Trace.
Run a triggering algorithm on the data of the current trace.
Cut current trace to given start and end time.
Verify current trace object against available meta data.
Save current trace into a file.
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
Search for and return channel response for the trace.
Add the given informational string to the processing field in the trace’s
Stats
object.Cut current trace to given start time.
Cut current trace to given end time.
Special Methods
Add another Trace object to current trace.
Default dir() implementation.
Split Trace into new Stream containing num Traces of the same size.
Implements rich comparison of Trace objects for “==” operator.
Default object formatter.
Too ambiguous, throw an Error.
__getitem__ method of Trace object.
Too ambiguous, throw an Error.
Initialize self.
This method is called when a class is subclassed.
Too ambiguous, throw an Error.
Return number of data samples of the current trace.
Too ambiguous, throw an Error.
Split Trace into new Stream containing Traces with num samples.
Create a new Stream containing num copies of this trace.
Implements rich comparison of Trace objects for “!=” operator.
Create and return a new object.
No data means no trace.
Return short summary string of the current trace.
Helper for pickle.
Helper for pickle.
__setattr__ method of Trace object.
Size of object in memory, in bytes.
Monkey patch for the __str__ method of the Trace object.
Abstract classes can override this to customize issubclass().
Split Trace into new Stream containing num Traces of the same size.