obspy.core.stream.Stream.detrend

Stream.detrend(type='simple')[source]

Remove a linear trend from all traces.

Parameters:type (str, optional) Method to use for detrending. Defaults to 'simple'. See the Supported Methods section below for further details.

Note

This operation is performed in place on the actual data arrays. The raw data is not accessible anymore afterwards. To keep your original data, use copy() to create a copy of your stream object. This also makes an entry with information on the applied processing in stats.processing of every trace.

Supported Methods

'simple'
Subtracts a linear function defined by first/last sample of the trace (uses obspy.signal.detrend.simple()).
'linear'
Fitting a linear function to the trace with least squares and subtracting it (uses scipy.signal.detrend()).
'constant' or 'demean'
Mean of data is subtracted (uses scipy.signal.detrend()).