Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for how to generate NEV and NSx files from data stream #72

Open
zeeMonkeez opened this issue Mar 11, 2017 · 3 comments
Open

Example for how to generate NEV and NSx files from data stream #72

zeeMonkeez opened this issue Mar 11, 2017 · 3 comments

Comments

@zeeMonkeez
Copy link

Is there example code for how to save NEV and NSx files using cbsdk?

Background: the auto-split feature of Central (to roll over files after fixed intervals of say 3600s) has a few problems: it confuses analog and digital signal generation for ~50ms, loses >4ms of data, and often does not get the file date (in the header) right, so that files have incorrect offset relative to each other.

@dashesy
Copy link
Collaborator

dashesy commented Mar 11, 2017

Nothing to save and NEV or NSx but n2h5 has a conversion to hdf5. The file format should be obvious here.

@zeeMonkeez
Copy link
Author

Sorry to open this again... Can you weigh in on best ways to capture the data? Essentially what I would do is to add a CBSDKCALLBACK_ALL, which extracts appropriate data and turns it into NEV/NSx packets, queues those in some thread-safe queues and have separate file save threads consume packets from these queues.
Does that sound stupid? Obviously, there'd have to be sanity checks in case the channel configuration changes.

@zeeMonkeez zeeMonkeez reopened this Mar 22, 2017
@dashesy
Copy link
Collaborator

dashesy commented Apr 18, 2017

I suggest recording to hdf file, but yes you should be able to listen to CBSDKCALLBACK_ALL and record analog and digital events. The problem is that then you have to go an update the headers, also you cannot change the channel settings in between.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants