MCPcopy
hub / github.com/mne-tools/mne-python / read_cov

Function read_cov

mne/cov.py:480–509  ·  view source on GitHub ↗

Read a noise covariance from a FIF file. Parameters ---------- fname : path-like The path-like of file containing the covariance matrix. It should end with ``-cov.fif`` or ``-cov.fif.gz``. %(verbose)s Returns ------- cov : Covariance The noise co

(fname, verbose=None)

Source from the content-addressed store, hash-verified

478
479@verbose
480def read_cov(fname, verbose=None):
481 """Read a noise covariance from a FIF file.
482
483 Parameters
484 ----------
485 fname : path-like
486 The path-like of file containing the covariance matrix. It should end
487 with ``-cov.fif`` or ``-cov.fif.gz``.
488 %(verbose)s
489
490 Returns
491 -------
492 cov : Covariance
493 The noise covariance matrix.
494
495 See Also
496 --------
497 write_cov, compute_covariance, compute_raw_covariance
498 """
499 from ._fiff.open import fiff_open
500
501 check_fname(
502 fname, "covariance", ("-cov.fif", "-cov.fif.gz", "_cov.fif", "_cov.fif.gz")
503 )
504 fname = _check_fname(fname=fname, must_exist=True, overwrite="read")
505 f, tree, _ = fiff_open(fname)
506 with f as fid:
507 return Covariance(
508 **_read_cov(fid, tree, FIFF.FIFFV_MNE_NOISE_COV, limited=True)
509 )
510
511
512###############################################################################

Callers 15

test_make_forward_dipoleFunction · 0.90
test_cov_scalingFunction · 0.90
test_ica_coreFunction · 0.90
test_ica_additionalFunction · 0.90
test_ica_covFunction · 0.90
test_channel_name_limitFunction · 0.90
test_gamma_map_standardFunction · 0.90

Calls 5

check_fnameFunction · 0.85
_check_fnameFunction · 0.85
fiff_openFunction · 0.85
CovarianceClass · 0.85
_read_covFunction · 0.85

Tested by 15

test_make_forward_dipoleFunction · 0.72
test_cov_scalingFunction · 0.72
test_ica_coreFunction · 0.72
test_ica_additionalFunction · 0.72
test_ica_covFunction · 0.72
test_channel_name_limitFunction · 0.72
test_gamma_map_standardFunction · 0.72