RDA client classes. See rdaclient.Client’s docstring for more information
An asynchronous RDA (Remote Data Access) client with buffer. Spawns a child process for storing constantly incoming data in the background.
Currently supports only float32 data type
| Parameters : | buffer_size : int, optional
buffer_window : int, optional
|
|---|
Notes
The RDA data sharing is used by the BrainVision software.
Attributes
| is_streaming | Checks whether the Streamer is active, read-only (bool) |
| buffer_size | Buffer capacity in samples, read-only (int) |
| data_dtype | Buffer’s data type, read-only (string) |
| buffer_window | Buffer pocket size, read-only (in samples) |
Methods
| connect(destaddr) | Connects to an RDA server |
| disconnect() | Disconnects the client from a server |
| get_data(sampleStart, sampleEnd) | Gets the data from the buffer. |
| poll(nSamples[, timeout, sleep]) | Gets the most resent data chunk from the buffer. |
| start_streaming([timeout]) | Starts data streaming from the server, using the following algorithm: 1. |
| stop_streaming([write_timelog]) | Stops streaming by sending corresponding signal to a Streamer process |
| wait(sampleStart, sampleEnd[, timeout, sleep]) | Gets the data from the buffer. |
Buffer capacity in samples, read-only (int)
Buffer pocket size, read-only (in samples)
Buffer’s data type, read-only (string)
Gets the data from the buffer. If possible, the data is returned in the form of a numpy view on the corresponding chunk (without copy)
| Parameters : | sampleStart : int
sampleEnd : int
|
|---|---|
| Returns : | data : ndarray (view or copy) or None
|
Checks whether the Streamer is active, read-only (bool)
Number of a last sample written to the buffer (= total no.)
Gets the most resent data chunk from the buffer. Blocks until the next data block is written to the buffer or timeout is over.
| Parameters : | nSamples : int
timeout : float
sleep : float
|
|---|---|
| Returns : | data : ndarray (view or copy) or None
|
Starts data streaming from the server, using the following algorithm:
| Parameters : | timeout : float, optional
|
|---|
Stops streaming by sending corresponding signal to a Streamer process
| Parameters : | write_timelog : bool, optional
|
|---|
Gets the data from the buffer. Blocks if data is not available and releases if one of the following is true:
| Parameters : | sampleStart : int
sampleEnd : int
timeout : float, optional
sleep : float, optional
|
|---|---|
| Returns : | data : ndarray (view or copy) or None
|
A Streamer class. Inherited from the multiprocessing.Process. It is spawned by a Client to work in the background and receive the data.
The buffer interface is initialized with a provided raw sharedctypes buffer array.
| Parameters : | q : Queue
fd : int
raw : sharectypes char array:
|
|---|
Methods
| is_alive() | Return whether process is alive |
| join([timeout]) | Wait until child process terminates |
| run() | The main streaming loop. |
| start() | Start child process |
| terminate() | Terminate process; sends SIGTERM signal or uses TerminateProcess() |