Created
April 9, 2018 16:45
-
-
Save bloyl/7f6a7910bf2afce5f198b6233f39416b 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
import os.path as op | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import mne | |
data_path = mne.datasets.sample.data_path() | |
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif') | |
evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True) | |
# only left aud | |
evoked = evoked[0] | |
lt_chans = [k['ch_name'] for k in evoked.info['chs'] | |
if k['loc'][0] <= 0 ] | |
evoked.info['bads'] = [] | |
evoked.plot(exclude=[], show=False) | |
evoked.info['bads'] += lt_chans | |
evoked.plot(exclude=[],show=False) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment