|
| 1 | +--- |
| 2 | +title: Common Stream Metadata |
| 3 | +weight: 15 |
| 4 | +--- |
| 5 | + |
| 6 | +Every Syntalos data stream carries a small key/value map of static metadata |
| 7 | +alongside the actual samples. Producers set the keys that are meaningful |
| 8 | +for their data; consumers default gracefully when a key is absent. |
| 9 | + |
| 10 | +The keys themselves are not enforced types - they are conventions shared |
| 11 | +across modules. This page is the canonical list. Module pages refer back |
| 12 | +to it where they handle a specific key. |
| 13 | + |
| 14 | +## Routing metadata |
| 15 | + |
| 16 | +These keys are set automatically by Syntalos on every output stream and |
| 17 | +are intended for downstream provenance / data-naming. Modules don't |
| 18 | +normally read or write them directly. |
| 19 | + |
| 20 | +| Key | Type | Description | |
| 21 | +|----------------------|--------|------------------------------------------------------------------| |
| 22 | +| `src_mod_type` | String | Type (unique identifier) of the source module. | |
| 23 | +| `src_mod_name` | String | User-defined name of the source module instance. | |
| 24 | +| `src_mod_port_title` | String | Title of the source module's output port. | |
| 25 | +| `data_name_proposal` | String | Proposed name for the dataset that stores data from this stream. | |
| 26 | + |
| 27 | + |
| 28 | +## Signal / sample streams |
| 29 | + |
| 30 | +For one-dimensional time-series streams (`SignalBlockU16`, |
| 31 | +`SignalBlockI32`, `SignalBlockF32`). |
| 32 | + |
| 33 | +| Key | Type | Default | Description | |
| 34 | +|----------------|----------------|----------------|--------------------------------------------------------------------------------------------------------------| |
| 35 | +| `sample_rate` | Double (Hz) | — | Sampling frequency. Required when `time_unit` is `index`, recommended otherwise. | |
| 36 | +| `time_unit` | String | `milliseconds` | One of `index`, `seconds`, `milliseconds`, `microseconds`. Describes the per-sample timestamps. | |
| 37 | +| `signal_names` | List\[String\] | — | Per-channel labels. The list length must match the channel count. | |
| 38 | +| `data_unit` | String | — | Physical unit of a sample *after* the affine transform below is applied (e.g. `µV`, `mPa`, `°C`). | |
| 39 | +| `data_scale` | Double | `1.0` | See `data_offset`. | |
| 40 | +| `data_offset` | Double | `0.0` | Together with `data_scale`, defines the affine relation between raw samples on the wire and physical values. | |
| 41 | + |
| 42 | + |
| 43 | +### The `data_unit` / `data_scale` / `data_offset` contract |
| 44 | + |
| 45 | +Consumers that want physical-unit values apply |
| 46 | + |
| 47 | +``` |
| 48 | +physical_value = data_scale * raw_value + data_offset |
| 49 | +``` |
| 50 | + |
| 51 | +and interpret the result as being in the unit named by `data_unit`. The |
| 52 | +defaults (`scale = 1.0`, `offset = 0.0`) make this a no-op for streams |
| 53 | +that already carry physical-unit samples, so producers that emit |
| 54 | +pre-scaled data only need to set `data_unit`. |
| 55 | + |
| 56 | +Two patterns are common: |
| 57 | + |
| 58 | +* **Pre-scaled** (e.g. [Intan RHX]({{< ref "modules/intan-rhx" >}})): samples arrive |
| 59 | + as `float32` already in µV. The module sets `data_unit = "µV"` and |
| 60 | + leaves `data_scale` / `data_offset` unset (i.e. identity). |
| 61 | +* **Raw + transform** (e.g. [Open Ephys AcqBoard]({{< ref "modules/open-ephys-acq" >}})): |
| 62 | + samples stay as `uint16` to minimize bandwidth and storage. The |
| 63 | + module sets `data_unit = "µV"`, `data_scale`, and |
| 64 | + `data_offset`. |
| 65 | + |
| 66 | +Writers ([Zarr Writer]({{< ref "modules/zarrwriter" >}}), [JSON Writer]({{< ref "modules/jsonwriter" >}})) |
| 67 | +persist the keys alongside the raw data so the conversion is recoverable |
| 68 | +even after a recording is closed. |
| 69 | + |
| 70 | + |
| 71 | +## Image / frame streams |
| 72 | + |
| 73 | +For `Frame` streams. |
| 74 | + |
| 75 | +| Key | Type | Description | |
| 76 | +|-------------|-------------|--------------------------------------------------------| |
| 77 | +| `framerate` | Double (Hz) | Frame rate. | |
| 78 | +| `size` | `MetaSize` | Frame dimensions in pixels (width × height). | |
| 79 | +| `has_color` | Bool | True if frames carry colour data, false if monochrome. | |
| 80 | + |
| 81 | + |
| 82 | +## Table-row streams |
| 83 | + |
| 84 | +For `TableRow` streams. |
| 85 | + |
| 86 | +| Key | Type | Description | |
| 87 | +|----------------|----------------|-------------------------------------------------------------------| |
| 88 | +| `table_header` | List\[String\] | Column names. The list length must match each row's column count. | |
0 commit comments