Channel label Status does not exist

Asked by Maciej Jedynak

Hi!

after running the example code, I got an error:

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pybdf.py", line 160, in __init__
    self.statusChanIdx = self.chanLabels.index("Status")

so, I guess the data I have don't have this label. But is it obligatory? Since my data seem not to have it, I guess it is not.
Wouldn't it be better to let someone look into the file anyway?

Question information

Language:
English Edit question
Status:
Answered
For:
pybdf Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
sam81 (samuele-carcagno) said :
#1

Hi, if you pass the argument status=True to the get_data method the status channel will be returned in the dictionary as a separate channel. See the doc for the get_data or get_data_parallel methods here

http://pythonhosted.org/pybdf/intro.html#module-pybdf

said this, I have taken care to return to encode properly the triggers in the trigger channel, I'm not sure the status channel is encoded correctly. It contains info like battery status and other info that I don't use routinely and for which I don't have enough info. Hope this helps!

Revision history for this message
sam81 (samuele-carcagno) said :
#2

To expand on my previous (quickly and badly written) answer. Here's an example of usage:

import pybdf
#Download and unpack the test recordings from here:
# http://www.biosemi.com/download/BDFtestfiles.zip

bdf_rec = pybdf.bdfRecording('Newtest17-256.bdf') #open the bdf file
dats = bdf_rec.get_data_parallel() #retrieve the data
#dats['data'] contains channels except the trigger and status channel
#dats['trigChan'] contains the triggers
#dats['statusChan'] contains the status channel
#if you look the channel labels, there is also a channel label named 'Status', try the following:
bdf_rec.chanLabels.index('Status')

in the raw bdf file the channel labelled "Status" contains two things: 16 bits are used to store
the triggers that were sent to the ActiveTwo, and 8 bits are used to store additional info automatically
generated by the ActiveTwo (e.g. whether the battery is low, or the CMS is in range), see here for a more
detailed description http://www.biosemi.com/faq/trigger_signals.htm
pybdf separates the triggers from this additional info and returns the triggers in
dats['trigChan'] and the additional info in dats['statusChan'].

Can you help with this problem?

Provide an answer of your own, or ask Maciej Jedynak for more information if necessary.

To post a message you must log in.