Created
March 31, 2020 21:35
-
-
Save dengemann/8206bc00e82853c5b97e951259a7984f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Denis A. Engemann <denis.engemann@gmail.com> | |
# | |
# License: BSD (3-clause)import mne | |
epochs_fname = 'XXX' # put real name here | |
raw_fname = 'YYY' # and here. | |
epo_rest = mne.read_epochs(epochs_fname, proj=False, verbose=None) | |
raw_noise = mne.io.read_raw_fif(raw_fname, preload=True) | |
raw_noise.filter(2, 40, fir_design='firwin') | |
raw_noise.crop(0, 60) | |
methods = ['shrunk', 'empirical'] | |
noise_covs = mne.compute_raw_covariance( | |
raw_noise, method=methods, | |
return_estimators=True) | |
for ii, noise_cov in enumerate(noise_covs): | |
fig1, fig2 = noise_cov.plot(raw_noise.info) | |
fig1.suptitle(methods[ii]) | |
fig2.suptitle(methods[ii]) | |
noise_covs2 = mne.compute_raw_covariance( | |
raw_noise, method=methods, | |
rank=69, | |
return_estimators=True) | |
for ii, noise_cov in enumerate(noise_covs2): | |
fig1, fig2 = noise_cov.plot(raw_noise.info) | |
fig1.suptitle(methods[ii]) | |
fig2.suptitle(methods[ii]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment