Skip to main content

Pure python interface to reading ddff files

Project description

Python library for reading ddff files

Introduction and set-up

DDFF is the DelftDataFileFormat, a convenient, binary data file format, based on msgpack packing and unpacking of struct-like data with a time or integer count tag. Data is written as msgpack arrays with two entries, the first is an unsigned (four byte) time or count tag, the second entry is the data.

To optimize performance, a suitable block size matching the physical device block size may be selected for the file. Multiple streams of data can be written to a file; the information of different streams is packed block-wise. Each block in the file has a small header, giving information on:

  • 8-byte unsigned integer pointing to the next block in the stream, or 0 if last block

  • 2-byte unsigned integer crc checksum for the block; all bytes of the block's data area except the present are included in this checksum

  • 2-byte unsigned integer, big endian, indicates the stream id

  • 4-byte unsigned integer, big endian, indicates this block's size.

  • 4-byte unsigned integer, big endian, indicates this block's fill level, i.e., number of data bytes, including the 28 control bytes.

  • 4-byte unsigned integer, big endian, indicates the offset of this block's first started write. 0 if no write started in this block; for starting reading at any place.

  • 4-byte unsigned integer, big endian, indicates the block number

This effectively gives a file with multiple streams (like virtual files) of binary data, with an effective block size of the chosen physical device block size - 28 bytes. Although not yet tested, the layout is designed to keep most of the file readable even in the presence of damage; the block sequence can be reconstructed by reading and checking the entire file, and the object offset combined with the structure information from the msgpack format enables resuming reading at any position.

Variants

The file format can be used as such, with multiple streams that are discovered as the file is parsed, but additional variants are possible, giving the following set of (currently defined) variants:

  • Base, with each stream (counting from 0), available for data. There is no information on the data content, other than given with the msgpack structure.

  • With an inventory, where stream #0 makes up the inventory. This inventory describes and names the remaining streams. It is coded in structs, with the following given and user-defined data:

    • key, a unique identifying string for the stream.

    • id, the stream number linked to the key.

    • label, a string with additional information the user wishes to add to further describe the stream. Commonly the label is a JSON-coded description of the data format in the stream.

  • With inventory and tagged. The inventory in stream #0 is given as above for the inventory. The tagging in stream #1 uses the following struct-like format:

    • cycle, an unsigned integer, indicating the recording number.

    • index0, a user-defined unsigned integer for the start of the recording.

    • index1, a user-defined unsigned integer for the end of the recording.

    • time, indicating a human readable time for the start of the recording.

    • label, a string label, to be chosen freely

    • offset, a vector of file offsets indicating the first blocks of each data stream (streams #2 and beyond), where the tag's first data is written.

This latter format is used by DUECA for record and replay of simulations. Each stream corresponds to a certain data set (as an example, the user input variables on a flight stick), and each tag corresponds to a recording.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyddff-1.0.2.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyddff-1.0.2-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pyddff-1.0.2.tar.gz.

File metadata

  • Download URL: pyddff-1.0.2.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyddff-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9d86525f178f4aeb5057ba1897e06af8092e0951626a7cecba0620f38604043d
MD5 2a8fb7603c033a52e2416204bd95fb80
BLAKE2b-256 fb962ded5bc3bac24ed5ce38e9ed19c8a7684d81edd996a1e7cd9dc4596d6660

See more details on using hashes here.

File details

Details for the file pyddff-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyddff-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyddff-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 968be1c5854280d2c871d59b702ae63150499cd9540ddf9e351370f9504971fe
MD5 f393565e798b20f2fae69b6161527723
BLAKE2b-256 b7117ab79b3e572138ce9d05aa39e17622341cdb3aeea52ede24b57e8bdb0198

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page