vallenae.io.encode_data_blob

vallenae.io.encode_data_blob(data, data_format, factor_millivolts, *, raw=False)[source]

Encodes array of voltage values to BLOB of 16-bit ADC values for memory-efficient storage.

Parameters:
  • data (ndarray) – Array with voltage values

  • data_format (int) –

    • 0: uncompressed

    • 2: FLAC compression

  • factor_millivolts (float) – Factor from int16 representation to millivolts. Stored in tradb -> tr_params as ‘TR_mV’

  • raw (bool) – Provide data as ADC values (int16), factor_millivolts will be ignored

Return type:

bytes

Returns:

Data blob