Data Elements
Data elements are produced by OpenEphys.Onix1 Bonsai operators. These pages contain information data elements that can help interpret and load data produced by Data I/O Operators.
In general, a data element comprises of properties which together contain timestamped data from a particular device. For example, Bno055Data outputs Bno055DataFrames which contains data produced by a BNO055 device:
- The data produced by the BNO055 is contained in the Acceleration, Calibration, EulerAngle, Gravity, and Temperature properties of the Bno055DataFrame. Any of these properties can be individually selected and visualized in Bonsai.
- The Clock property contains the precise hardware timestamp for the data in the properties described in the first bullet point created using the global ONIX Controller clock. This Clock property can be used to sync BNO055 data with data from all other devices from which ONIX is acquiring and put it all onto the same timeline.
- The HubClock property contains the precise hardware timestamp created using the clock on the hardware that contains the device.
There are some exceptions to the pattern described above. For example:
- ContextTask is an object passed through the configuration chain for writing to and reading from the ONIX hardware.
- OutputClockParameters outputs the parameters used to set the precise hardware output clock when the workflow starts.
These pages also describe the type of each property. This type information can be used to calculate the rate of data produced by the devices enabled in your experiment. For example, the NeuropixelsV2eData operator (which outputs the data from a single Neuropixels 2.0 probe device) produces a sequence of NeuropixelsV2eDataFrames. Using the fact that each sample comprises of a Clock property (8 bytes), a HubClock property (8 bytes), and an AmplifierData property (384*2 bytes), this device's data rate is:
NeuropixelsV2eDataFrame is actually a buffered data frame (as indicated by the presence of NeuropixelsV2eData's BufferSize property), meaning that several data samples and their timestamps are buffered into a single NeuropixelsV2eDataFrame. The above calculation was calculated under the assumption that NeuropixelsV2eData's BufferSize property is set to 1. Although the calculation is slightly different when BufferSize is more than 1, the end result ends up being the same. When BufferSize is more than 1, NeuropixelsV2eDataFrames are produced at a rate 30 kHz divided by the value of BufferSize. Each NeuropixelsV2eDataFrame comprises of:
- a Clock property: an array of ulong (each 8 bytes) of length N
- a HubClock property: an array of ulong (each 8 bytes) of length N
- an AmplifierData property: a Mat of ushort (each 2 bytes) of size 384 x N
where N is a stand-in for BufferSize. Therefore, the calculation becomes:
N cancels out and the result is the same.
Knowing the type of each property can also be helpful in two more ways:
- A property's type indicates how a property can be used in Bonsai. Operators typically accept only a specific type or set of types as inputs. When types don't match, Bonsai indicates an error.
- If a property is saved using a MatrixWriter (i.e. as a raw
binary file), knowing its type informs how to load the data. For example,
the dtypes in
our example Breakout Board data-loading script
were selected according to the size of each data being saved. For example,
digital input clock samples are saved using 8 bytes which requires
dt=np.uint64
when loading, and digital input pin samples are saved using a single byte which requiresdt=np.uint8
when loading.