determine sampling rate via python API #653

Fab (2024-07-29 09:18) · 315 view(s)

Hi,

I have data recorded using VitalRecorder which I am reading via the VitalDB Python Library.
To properly read the data with their original sampling rate (i.e., the rate at which each track was recorded) I would like to determine the sampling rate of each track prior to reading the data.
Is there no way to read the original sampling rate for each track (e.g., I would expect this when reading header information).

Moreover, when I am reading a track using vitaldb.VitalFile.get_track_samples(dtname, interval) I wanted to specify interval=None expecting the output having the original (or a default) sampling rate.
However, setting interval=None seems not to work and raises an error (TypeError: unsupported operand type(s) for /: 'float' and 'NoneType').
This seems to be in contradiction to the docs which state the interval can be set to None: https://vitaldb.net/docs/?documentId=1j702xfDef7RNhfZANQQt7tkzzbin2FVe9GAnleDSyzI

Thanks a lot for your help and for providing this amazing tool,
Fab