mne.baseline.rescale

mne.baseline.rescale(data, times, baseline, mode='mean', copy=True, picks=None, verbose=None)[source]

Rescale (baseline correct) data.

Parameters
dataarray

It can be of any shape. The only constraint is that the last dimension should be time.

times1D array

Time instants is seconds.

baselineNone | tuple of length 2

The time interval to consider as “baseline” when applying baseline correction. If None, do not apply baseline correction. If a tuple (a, b), the interval is between a and b (in seconds), including the endpoints. If a is None, the beginning of the data is used; and if b is None, it is set to the end of the interval. If (None, None), the entire time interval is used.

Note

The baseline (a, b) includes both endpoints, i.e. all timepoints t such that a <= t <= b.

mode‘mean’ | ‘ratio’ | ‘logratio’ | ‘percent’ | ‘zscore’ | ‘zlogratio’

Perform baseline correction by

  • subtracting the mean of baseline values (‘mean’)

  • dividing by the mean of baseline values (‘ratio’)

  • dividing by the mean of baseline values and taking the log (‘logratio’)

  • subtracting the mean of baseline values followed by dividing by the mean of baseline values (‘percent’)

  • subtracting the mean of baseline values and dividing by the standard deviation of baseline values (‘zscore’)

  • dividing by the mean of baseline values, taking the log, and dividing by the standard deviation of log baseline values (‘zlogratio’)

copybool

Whether to return a new instance or modify in place.

pickslist of int | None

Data to process along the axis=-2 (None, default, processes all).

verbosebool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only.

Returns
data_scaled: array

Array of same shape as data after rescaling.