TimeNet VitalDB reader¶
The reader that loads VitalDB's .vital files with this atlas's corrections applied: records after each reset put back in order, every sample placed by its count, the corrected scale factors and the whole-file time zero.
| Repository | github.com/OpenTSLM/TimeNet |
| Branch | main |
| Visibility | public |
| Language | Python |
| Documentation | https://docs.timenet.ai |
| Related | vitaldb-bench |
What it is¶
The VitalDB reader is one of the dataset connectors in the open TimeNet project (timenet-connectors). It reads
.vital files into records and tracks with exact sample times. The atlas uses it as the place where its findings
about the files are applied on reading, so an analysis that loads VitalDB through it starts from corrected data.
Its part in the atlas¶
What the reader does about the atlas's observations:
- Reset blocks out of order. It puts the five records after each SNUADC reset back in sampling order
(on by default;
VITALDB_RESET_ORDER=offturns it off) and records the rule on each record (Five records out of order at every SNUADC reset). - Samples placed by count. Every sample is kept and placed by its count, so none are lost to the stamp arithmetic (SNUADC stamps run −0.95 ppm against the sample count, Stamp-based loaders lose samples at overlaps).
- Corrected scale factors for the Primus waveforms and the mislabelled arterial tracks (Primus waveform gains are wrong in every recording, for CO₂ or for AWP, Three ART tracks carry the PLETH conversion factors).
- Whole-file time zero (Time zero depends on the tracks loaded).
- Numeric delay labels (Monitor numerics describe the past, never the future).
vitaldb-bench checks what it reads against the source files. Changes to the reader made during this work may be ahead of the public repository until they are merged.
What is in it¶
The VitalDB reader¶
connector.py |
Reads .vital files into TimeNet records; import options, including the reset reordering. |
resets.py |
Finds the reset clusters in an SNUADC track and puts their records back in sampling order. |
test_resets.py |
Tests of the reordering rule, including the variant clusters. |
Studies that use it¶
| Study | Code | Summary |
|---|---|---|
| Records out of order at SNUADC resets, and where the lost time goes | …/vitaldb/resets.py, …/tests/test_resets.py |
At every SNUADC reset the five records after it are written out of order: two continue the old timing and three start the new. Put back in order, the waveform runs on with no samples missing; the 18–20 ms lost at each reset goes missing inside the last old-timing record, and an extra zero sample follows. |
Observations it handles¶
| Observation | Status | Summary |
|---|---|---|
| Five records out of order at every SNUADC reset | established | At each step-mode reset the five records after it are written in the wrong order: two continue the old timing and three start the new, interleaved. Read in file order, or sorted by stamp, one second of signal is scrambled. |
| Primus waveform gains are wrong in every recording, for CO₂ or for AWP | established | Recordings store the Primus waveforms with one of three sets of scale factors. Checked against the Primus's own ETCO₂ and PIP numerics in all 6,388 recordings, CO₂ fits only 0.075 mmHg per code and AWP only 0.1 mbar per code with offset −20, so most recordings overstate CO₂ by a third, and the others overstate AWP by about 3% (950 recordings) or understate it about fourfold (26). |
| SNUADC stamps run −0.95 ppm against the sample count | established | Between corrections each 0.2 s record stamp increment is about 0.19 µs short: stamps run −0.95 ppm from the sample count in 88% of files (both SNUADC modes). It is arithmetic, not clock drift. The other 12% sit between −0.90 and −0.55 ppm. |
Mentioned in¶
- Observation: Three ART tracks carry the PLETH conversion factors
- Observation: Time zero depends on the tracks loaded
- Observation: Stamp-based loaders lose samples at overlaps
- Observation: Monitor numerics describe the past, never the future
- Observation: Primus waveform gains are wrong in every recording, for CO₂ or for AWP
- Observation: Five records out of order at every SNUADC reset
- Observation: In 34 files the SNUADC records overlap throughout
- Observation: SNUADC stamps run −0.95 ppm against the sample count
- Observation: Solar8000 ST records are written twice
- Software: vitaldb-bench
- Studie: Anaesthesia record times are rounded up
- Studie: Records out of order at SNUADC resets, and where the lost time goes
- Studie: SNUADC stamp arithmetic
- Studie: Time zeros and loaded subsets
- Studie: The vitaldb package's loading conventions
- Variable: Arterial pressure (SNUADC)
- Variable: ECG lead II (SNUADC)
- Variable: Plethysmogram (SNUADC)
References¶
- Maritsch M, Stoffregen T, Kaar T, et al. TimeNet: an extensible unified data infrastructure for next-generation temporal foundation models. arXiv:2610.04407. 2026. ↗