mne.compute_rank¶
-
mne.
compute_rank
(inst, rank=None, scalings=None, info=None, tol='auto', proj=True, verbose=None)[source]¶ Compute the rank of data or noise covariance.
This function will normalize the rows of the data (typically channels or vertices) such that non-zero singular values should be close to one.
- Parameters
- instinstance of
Raw
,Epochs
, orCovariance
Raw measurements to compute the rank from or the covariance.
- rank
None
|dict
| ‘info’ | ‘full’ This controls the rank computation that can be read from the measurement info or estimated from the data. See
Notes
ofmne.compute_rank()
for details.The default is None.- scalings
dict
|None
(defaultNone
) Defaults to
dict(mag=1e15, grad=1e13, eeg=1e6)
. These defaults will scale different channel types to comparable values.- infoinstance of
Info
|None
The measurement info used to compute the covariance. It is only necessary if inst is a Covariance object (since this does not provide
inst.info
).- tol
float
|str
Tolerance. See
estimate_rank
.- projbool
If True, all projs in
inst
andinfo
will be applied or considered whenrank=None
orrank='info'
.- verbosebool,
str
,int
, orNone
If not None, override default verbose level (see
mne.verbose()
and Logging documentation for more).
- instinstance of
- Returns
- rank
dict
Estimated rank of the data for each channel type. To get the total rank, you can use
sum(rank.values())
.
- rank
Notes
The
rank
parameter can be:None
(default)Rank will be estimated from the data after proper scaling of different channel types.
'info'
Rank is inferred from info. If data have been processed with Maxwell filtering, the Maxwell filtering header is used. Otherwise, the channel counts themselves are used. In both cases, the number of projectors is subtracted from the (effective) number of channels in the data. For example, if Maxwell filtering reduces the rank to 68, with two projectors the returned value will be 68.
'full'
Rank is assumed to be full, i.e. equal to the number of good channels. If a
Covariance
is passed, this can make sense if it has been (possibly improperly) regularized without taking into account the true data rank.int
This value is used as the MEG rank. For other channel types, rank is taken from
info
. This is deprecated and will be removed in 0.19, usedict(meg=...)
instead.
New in version 0.18.