Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. # Authors: Denis A. Engemann <denis.engemann@gmail.com>
  2. # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
  3. #
  4. # License: BSD (3-clause)
  5. import mne
  6. data_path = mne.datasets.somato.data_path()
  7. raw_fname = data_path + '/MEG/somato/sef_raw_sss.fif'
  8. event_id, tmin, tmax = 1, -1., 3.
  9.  
  10. # Setup for reading the raw data
  11. raw = mne.io.Raw(raw_fname, preload=True)
  12. raw.filter(1, 30, method='iir')
  13.  
  14. baseline = None
  15. events = mne.find_events(raw, stim_channel='STI 014')
  16.  
  17. # picks MEG gradiometers
  18. picks = mne.pick_types(raw.info, meg=True, eeg=False, eog=True, stim=False)
  19.  
  20. epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
  21. baseline=baseline, reject=dict(grad=4000e-13, eog=350e-6),
  22. preload=True)
  23. ###############################################################################
  24. # Compute covariance using automated regularization and show whitening
  25. noise_covs = mne.cov.compute_covariance(epochs[:30], tmax=0, method='auto',
  26. return_estimators=True)
  27.  
  28. evoked = epochs.average()
  29. evoked.plot() # plot evoked response
  30. evoked.plot_white(noise_covs) # compare estimators
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement