def test_read_epochs(): event_id = 1 tmin = -0.2 tmax = 0.5 # Setup for reading the raw data raw = fiff.setup_read_raw(raw_fname) events = mne.read_events(event_name) # Set up pick list: MEG + STI 014 - bad channels (modify to your needs) include = ["STI 014"] want_meg = True want_eeg = False want_stim = False picks = fiff.pick_types(raw["info"], want_meg, want_eeg, want_stim, include, raw["info"]["bads"]) data, times, channel_names = mne.read_epochs(raw, events, event_id, tmin, tmax, picks=picks, baseline=(None, 0))
""" # Author: Alexandre Gramfort <*****@*****.**> # # License: BSD (3-clause) print __doc__ import os import mne from mne import fiff fname = os.environ['MNE_SAMPLE_DATASET_PATH'] fname += '/MEG/sample/sample_audvis_raw.fif' raw = fiff.setup_read_raw(fname) # Set up pick list: MEG + STI 014 - bad channels want_meg = True want_eeg = False want_stim = False picks = fiff.pick_types(raw['info'], meg=want_meg, eeg=want_eeg, stim=want_stim, exclude=raw['info']['bads']) print "Number of picked channels : %d" % len(picks) full_cov = mne.Covariance(kind='full') full_cov.estimate_from_raw(raw, picks=picks) print full_cov
from mne import fiff ############################################################################### # Set parameters raw_fname = os.environ['MNE_SAMPLE_DATASET_PATH'] # raw_fname += '/MEG/sample/sample_audvis_raw.fif' raw_fname += '/MEG/sample/sample_audvis_filt-0-40_raw.fif' event_fname = os.environ['MNE_SAMPLE_DATASET_PATH'] # event_fname += '/MEG/sample/sample_audvis_raw-eve.fif' event_fname += '/MEG/sample/sample_audvis_filt-0-40_raw-eve.fif' event_id = 1 tmin = -0.2 tmax = 0.5 # Setup for reading the raw data raw = fiff.setup_read_raw(raw_fname) events = mne.read_events(event_fname) # Set up pick list: MEG + STI 014 - bad channels (modify to your needs) include = [] # or stim channel ['STI 014'] exclude = raw['info']['bads'] + ['MEG 2443', 'EEG 053'] # bads + 2 more # MEG Magnetometers meg_mag_picks = fiff.pick_types(raw['info'], meg='mag', eeg=False, stim=False, include=include, exclude=exclude) meg_mag_data, times, channel_names = mne.read_epochs(raw, events, event_id, tmin, tmax, picks=meg_mag_picks, baseline=(None, 0)) meg_mag_epochs = np.array([d['epoch'] for d in meg_mag_data]) # as 3D matrix meg_mag_evoked_data = np.mean(meg_mag_epochs, axis=0) # compute evoked fields # MEG
""" # Author: Alexandre Gramfort <*****@*****.**> # # License: BSD (3-clause) print __doc__ import os from math import ceil from mne import fiff infile = os.environ['MNE_SAMPLE_DATASET_PATH'] infile += '/MEG/sample/sample_audvis_raw.fif' outfile = 'sample_audvis_small_raw.fif' raw = fiff.setup_read_raw(infile) # Set up pick list: MEG + STI 014 - bad channels want_meg = True want_eeg = False want_stim = False include = ['STI 014'] # include = [] # include = ['STI101', 'STI201', 'STI301'] picks = fiff.pick_types(raw['info'], meg=want_meg, eeg=want_eeg, stim=want_stim, include=include, exclude=raw['info']['bads']) print "Number of picked channels : %d" % len(picks)