%pylab inline
import bioread
pylab.rcParams['figure.figsize'] = (14.0, 12.0) # Make figures a bit bigger
# This file is included in bioread
data = bioread.read_file('test/data/physio/physio-4.4.0.acq')
data
data.channels
plt.subplot(211)
for chan in data.channels:
plt.plot(chan.time_index, chan.data, label='{} ({})'.format(chan.name, chan.units))
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
ncol=1, mode="expand", borderaxespad=0.)
None # Don't print a silly legend thing
# The computed channel is putting the others way off-scale, let's exclude it
plt.subplot(211)
for chan in data.channels[1:]:
plt.plot(chan.time_index, chan.data, label='{} ({})'.format(chan.name, chan.units))
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
ncol=1, mode="expand", borderaxespad=0.)
None # Don't print a silly legend thing
# And let's separate resp and ekg so we can see their traces better
plt.subplot(211)
ekg = data.channels[1]
resp = data.channels[2]
eda = data.channels[3]
plt.plot(ekg.time_index, ekg.data, label='{} ({})'.format(ekg.name, ekg.units))
plt.plot(resp.time_index, resp.data + 1.5, label='{} ({})'.format(resp.name, resp.units))
plt.plot(eda.time_index, eda.data, label='{} ({})'.format(eda.name, eda.units))
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
ncol=1, mode="expand", borderaxespad=0.)
None # Don't print a silly legend thing
for m in data.event_markers:
print('{0}: Channel {1}, type {2}'.format(m.text, m.channel_name, m.type))