detrend(data,
perchunk=False,
model='linear',
polyord=None,
opt_reg=None)
| source code
|
Given a dataset, detrend the data inplace either entirely
or per each chunk
- Parameters:
data (Dataset) - dataset to operate on
perchunk (bool) - either to operate on whole dataset at once or on each chunk
separately
model - Type of detrending model to run. If 'linear' or 'constant',
scipy.signal.detrend is used to perform a linear or demeaning
detrend. If 'regress', then you specify the polyord and opt_reg
arguments to define regressors to regress out of the dataset.
polyord (int or list) - Order of the Legendre polynomial to remove from the data. This
will remove every polynomial up to and including the provided
value. For example, 3 will remove 0th, 1st, 2nd, and 3rd order
polynomials from the data. N.B.: The 0th polynomial is the
baseline shift, the 1st is the linear trend.
If you specify a single int and perchunk is True, then this value
is used for each chunk. You can also specify a differnt polyord
value for each chunk by providing a list or ndarray of polyord
values the length of the number of chunks.
opt_reg (ndarray) - Optional ndarray of additional information to regress out from the
dataset. One example would be to regress out motion parameters.
As with the data, time is on the first axis.
|