File: read_noise_covariance_matrix.py

package info (click to toggle)
python-mne 1.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 131,492 kB
  • sloc: python: 213,302; javascript: 12,910; sh: 447; makefile: 144
file content (31 lines) | stat: -rw-r--r-- 695 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
.. _ex-read-noise-cov:

=========================================
Reading/Writing a noise covariance matrix
=========================================

How to plot a noise covariance matrix.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

# %%

import mne
from mne.datasets import sample

data_path = sample.data_path()
fname_cov = data_path / "MEG" / "sample" / "sample_audvis-cov.fif"
fname_evo = data_path / "MEG" / "sample" / "sample_audvis-ave.fif"

cov = mne.read_cov(fname_cov)
print(cov)
ev_info = mne.io.read_info(fname_evo)

# %%
# Plot covariance

cov.plot(ev_info, exclude="bads", show_svd=False)