- MNE version: 1.3.1
- operating system: / Ubuntu 18.04.5 LTS
I noticed some odd ranks being reported when the data covariance matrix from sss’d data is passed to make_lcmv
: the reported rank is the number of good channels, rather than the much-lower rank you’d expect after SSS/tSSS. With make_lcmv
the computed rank from the data covariance matrix eventually gets passed to _compute_beamformer
, where it affects things downstream like the computation of the pseudoinverse. The higher (incorrect?) rank appears to be a result of passing raw.info through mne.io.meas_info._simplify_info
on line 145 of make_lcmv
(see mne-python/_lcmv.py at 7d389814213b1f2c9e67c5af4049ee1b07654744 · mne-tools/mne-python · GitHub) when the rank of the covariance matrix is calculated. For example if you do:
from mne.datasets import testing
import mne
data_path = testing.data_path()
fname_raw = data_path / 'SSS' / 'sample_audvis_trunc_raw_sss.fif'
raw = mne.io.Raw(fname_raw, preload=True)
data_cov = mne.compute_raw_covariance(raw, tmin=0, tmax=None, picks=picks, reject_by_annotation=False, rank='info', method='empirical')
print('Computing data_cov rank using original info')
mne.rank.compute_rank(data_cov, rank='info', info=raw.info)
print('Computing data_cov rank using simplified info')
info_dcov = mne.io.meas_info._simplify_info(raw.info)
mne.rank.compute_rank(data_cov, rank='info', info=info_dcov)
You get a rank of 69 using raw.info and a rank of 306 using info_dcov. Is this issue-worthy or have I misunderstood the code?
Thanks
Jon