Pymeg Data Plot
First use the 4D to python reader as shown here pymeg-data-import
to reiterate to plot for example the 2D data as a simple line plot, use the pylab module for the graphics.
from pdf2py import channel, data
from pylab import *
d=data.read(file)
ch=channel.index(file, 'meg')
d.getdata(0, 200, chindex=ch.channelindexhdr)
from meg import offset
figure();plot(offset.correct(d.data_block));
but before plotting the MEG lets add the trigger channels (trigger and response) to the plot.
ch=channel.index(file, 'trig')
t=data.read(file)
t.getdata(0, 200, chind=ch.channelindexhdr)
but before plotting we should scale the trigger channel, as if too large, will dwarf the MEG channel scale.
we will use the module 'max' from numpy to get the largest scale of both the MEG and triggers to scale by.
from numpy import *
plot(offset.correct(t.data_block/(t.data_block.max()/d.data_block.max())));
show()

page_revision: 28, last_edited: 1238176862|%e %b %Y, %H:%M %Z (%O ago)








