forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_shift_evoked.py
More file actions
43 lines (31 loc) · 1.11 KB
/
Copy pathplot_shift_evoked.py
File metadata and controls
43 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
==================================
Shifting time-scale in evoked data
==================================
"""
# Author: Mainak Jas <mainak@neuro.hut.fi>
#
# License: BSD (3-clause)
print __doc__
import pylab as pl
from mne import fiff
from mne.datasets import sample
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
# Reading evoked data
evoked = fiff.Evoked(fname, setno='Left Auditory',
baseline=(None, 0), proj=True)
picks = fiff.pick_channels(ch_names=evoked.info['ch_names'],
include="MEG 2332", exclude="bad")
# Create subplots
f, axarr = pl.subplots(3)
evoked.plot(exclude=[], picks=picks, axes=axarr[0],
titles=dict(grad='Before time shifting'))
# Apply relative time-shift of 500 ms
evoked.shift_time(0.5, relative=True)
evoked.plot(exclude=[], picks=picks, axes=axarr[1],
titles=dict(grad='Relative shift: 500 ms'))
# Apply absolute time-shift of 500 ms
evoked.shift_time(0.5, relative=False)
evoked.plot(exclude=[], picks=picks, axes=axarr[2],
titles=dict(grad='Absolute shift: 500 ms'))