Created
November 16, 2017 18:20
-
-
Save bloyl/2f067bcf5f84144e090d45fa01836ced 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 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) | |
evoked_l_aud = evoked[0] | |
# restrict to magnetometers | |
evoked_l_aud.pick_types(meg='mag') | |
# pick the right channels | |
rt_chans = [k['ch_name'] for k in evoked_l_aud.info['chs'] | |
if k['loc'][0] >= 0] | |
rt_picks = mne.pick_channels(evoked_l_aud.info['ch_names'], rt_chans) | |
# make a dataset just of right channels. | |
evoked_l_aud_rt_chans = evoked_l_aud.copy() | |
evoked_l_aud_rt_chans.pick_channels(rt_chans) | |
# test plot_joint | |
evoked_l_aud.plot_joint(times=[0.089], show=False) | |
evoked_l_aud.plot_joint(times=[0.089], picks=rt_picks, show=False) | |
evoked_l_aud_rt_chans.plot_joint(times=[0.089], show=False) | |
plt.show() | |
# what about topo plot | |
evoked_l_aud.plot_topomap(times=[0.089], show=False) | |
evoked_l_aud_rt_chans.plot_topomap(times=[0.089], show=False) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment