-
Notifications
You must be signed in to change notification settings - Fork 22
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
Reading continuous data with cbpy #88
Comments
I wrote a convenience class for myself that wraps cbpy that I use in a few different applications. |
@cboulay how do you match sample times between events and continuous data in this use case? |
@zeeMonkeez Hi Jonas. Sorry I can't look into it right now. (going to Asilomar? I am nowhere near ready) Anyway, there's a recently contributed I haven't had a need for this because my I'm either looking at these things independently, or I'm looking at them offline loaded from .nev/.nsx files, but I think that's going to change. |
@cboulay Hey Chad, thanks I'll have a look. No, Asilomar didn't fit in my schedule. I'll be in Minneapolis in June, though, will you be there? Seems like you're up to doing some cool things, it'd be cool to chat... |
@jsv13 Very late reply, but in case anyone else encounters this, I've noticed that channels coming from the Analog Inputs aren't replayed by nPlayServer. |
According to Blackrock support this is a known bug in the current version 7, a fix is upcoming, and it should also not happen in nPlayServer versions 6.5.4 and below. |
Closing. Use #97 |
I am also trying to read continuous data only using cbpy and have encountered the following issue. I have a main program which queries the device for new data continuously (i.e., no sleep commands in-between). I have set the from cerebus import cbpy
samples_per_read = 100
buffer_parameter = {
'double': True,
'continuous_length': samples_per_read
}
result, _ = cbpy.trial_config(
reset=True,
buffer_parameter=buffer_parameter)
def read():
result, trial = cbpy.trial_continuous(reset=True)
data = process(trial)
return data Now, ideally I would want to continuously read data in a loop, such that execution is blocked until the new data become available, something like: while True:
data = read() I would expect program execution to be blocked until data become available since Alternatively, I could set the number of samples per read to 1 and internally check if the desired samples have been read, but querying the device sample by sample sounds a bit like an overkill. Any ideas? Thanks. |
It would be a non-trivial amount of work to add a timeout parameter to SdkGetTrialData. It's tricky to do correctly and I don't have time for that right now. The simplest solution is to buffer the data on the client side. Or, better yet, have your analysis pipeline be flexible to the number of samples it receives (ultimately that usually means buffering at some stage). If you want to make an argument for a blocking call to fetch data or you want to propose a way to do that then please open a new issue. |
I manage to retrieve events from nPlayServer with cbpy, but I cannot get continuous data. Streaming continuous data is on, e.g. I can get them via the cbSDK.
Can anyone provide an example showing how to get continuous data in cbpy?
thanks!
The text was updated successfully, but these errors were encountered: