Skip to main content

ASAM MDF measurement data file parser

Project description

asammdf is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.

asammdf supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).

asammdf works on Python >= 3.8

Status

Continuous Integration Coveralls Codacy ReadTheDocs
continuous integration Coverage Status Codacy Badge Documentation Status
PyPI conda-forge
PyPI version conda-forge version

Project goals

The main goals for this library are:

  • to be faster than the other Python based mdf libraries
  • to have clean and easy to understand code base
  • to have minimal 3-rd party dependencies

Features

  • create new mdf files from scratch

  • append new channels

  • read unsorted MDF v3 and v4 files

  • read CAN and LIN bus logging files

  • extract CAN and LIN signals from anonymous bus logging measurements

  • filter a subset of channels from original mdf file

  • cut measurement to specified time interval

  • convert to different mdf version

  • export to HDF5, Matlab (v7.3), CSV and parquet

  • merge multiple files sharing the same internal structure

  • read and save mdf version 4.10 files containing zipped data blocks

  • space optimizations for saved files (no duplicated blocks)

  • split large data blocks (configurable size) for mdf version 4

  • full support (read, append, save) for the following map types (multidimensional array channels):

    • mdf version 3 channels with CDBLOCK

    • mdf version 4 structure channel composition

    • mdf version 4 channel arrays with CNTemplate storage and one of the array types:

      • 0 - array
      • 1 - scaling axis
      • 2 - look-up
  • add and extract attachments for mdf version 4

  • handle large files (for example merging two fileas, each with 14000 channels and 5GB size, on a RaspberryPi)

  • extract channel data, master channel and extra channel information as Signal objects for unified operations with v3 and v4 files

  • time domain operation using the Signal class

    • Pandas data frames are good if all the channels have the same time based
    • a measurement will usually have channels from different sources at different rates
    • the Signal class facilitates operations with such channels
  • graphical interface to visualize channels and perform operations with the files

Major features not implemented (yet)

  • for version 3

    • functionality related to sample reduction block: the samples reduction blocks are simply ignored
  • for version 4

    • experimental support for MDF v4.20 column oriented storage
    • functionality related to sample reduction block: the samples reduction blocks are simply ignored
    • handling of channel hierarchy: channel hierarchy is ignored
    • full handling of bus logging measurements: currently only CAN and LIN bus logging are implemented with the ability to get signals defined in the attached CAN/LIN database (.arxml or .dbc). Signals can also be extracted from an anonymous bus logging measurement by providing a CAN or LIN database (.dbc or .arxml)
    • handling of unfinished measurements (mdf 4): finalization is attempted when the file is loaded, however the not all the finalization steps are supported
    • full support for remaining mdf 4 channel arrays types
    • xml schema for MDBLOCK: most metadata stored in the comment blocks will not be available
    • full handling of event blocks: events are transferred to the new files (in case of calling methods that return new MDF objects) but no new events can be created
    • channels with default X axis: the default X axis is ignored and the channel group's master channel is used
    • attachment encryption/decryption using user provided encryption/decryption functions; this is not part of the MDF v4 spec and is only supported by this library

Usage

from asammdf import MDF

mdf = MDF('sample.mdf')
speed = mdf.get('WheelSpeed')
speed.plot()

important_signals = ['WheelSpeed', 'VehicleSpeed', 'VehicleAcceleration']
# get short measurement with a subset of channels from 10s to 12s
short = mdf.filter(important_signals).cut(start=10, stop=12)

# convert to version 4.10 and save to disk
short.convert('4.10').save('important signals.mf4')

# plot some channels from a huge file
efficient = MDF('huge.mf4')
for signal in efficient.select(['Sensor1', 'Voltage3']):
   signal.plot()

Check the examples folder for extended usage demo, or the documentation http://asammdf.readthedocs.io/en/master/examples.html

https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/

Documentation

http://asammdf.readthedocs.io/en/master

And a nicely written tutorial on the CSS Electronics site

Contributing & Support

Please have a look over the contributing guidelines

If you enjoy this library please consider making a donation to the numpy project or to danielhrisca using liberapay <a href="https://liberapay.com/danielhrisca/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>

Contributors

Thanks to all who contributed with commits to asammdf:

Installation

asammdf is available on

pip install asammdf
# for the GUI 
pip install asammdf[gui]
# or for anaconda
conda install -c conda-forge asammdf

In case a wheel is not present for you OS/Python versions and you lack the proper compiler setup to compile the c-extension code, then you can simply copy-paste the package code to your site-packages. In this way the python fallback code will be used instead of the compiled c-extension code.

Dependencies

asammdf uses the following libraries

  • numpy : the heart that makes all tick
  • numexpr : for algebraic and rational channel conversions
  • wheel : for installation in virtual environments
  • pandas : for DataFrame export
  • canmatrix : to handle CAN/LIN bus logging measurements
  • natsort
  • lxml : for canmatrix arxml support
  • lz4 : to speed up the disk IO performance
  • python-dateutil : measurement start time handling

optional dependencies needed for exports

  • h5py : for HDF5 export
  • hdf5storage : for Matlab v7.3 .mat export
  • fastparquet : for parquet export
  • scipy: for Matlab v4 and v5 .mat export

other optional dependencies

  • PySide6 : for GUI tool
  • pyqtgraph : for GUI tool and Signal plotting
  • matplotlib : as fallback for Signal plotting
  • faust-cchardet : to detect non-standard Unicode encodings
  • chardet : to detect non-standard Unicode encodings
  • pyqtlet2 : for the GPS window
  • isal : for faster zlib compression/decompression
  • fsspec : access files stored in the cloud

Benchmarks

http://asammdf.readthedocs.io/en/master/benchmarks.html

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

asammdf-7.4.5.tar.gz (751.6 kB view details)

Uploaded Source

Built Distributions

asammdf-7.4.5-cp312-cp312-win_amd64.whl (833.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

asammdf-7.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (858.2 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

asammdf-7.4.5-cp312-cp312-macosx_11_0_arm64.whl (829.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

asammdf-7.4.5-cp311-cp311-win_amd64.whl (833.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

asammdf-7.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (857.7 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

asammdf-7.4.5-cp311-cp311-macosx_11_0_arm64.whl (828.9 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

asammdf-7.4.5-cp310-cp310-win_amd64.whl (833.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

asammdf-7.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (856.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

asammdf-7.4.5-cp310-cp310-macosx_11_0_arm64.whl (828.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

asammdf-7.4.5-cp39-cp39-win_amd64.whl (833.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

asammdf-7.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (856.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

asammdf-7.4.5-cp39-cp39-macosx_11_0_arm64.whl (828.9 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

asammdf-7.4.5-cp38-cp38-win_amd64.whl (833.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

asammdf-7.4.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (857.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

asammdf-7.4.5-cp38-cp38-macosx_11_0_arm64.whl (828.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

File details

Details for the file asammdf-7.4.5.tar.gz.

File metadata

  • Download URL: asammdf-7.4.5.tar.gz
  • Upload date:
  • Size: 751.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5.tar.gz
Algorithm Hash digest
SHA256 b0c149daea22c5b2a47ceb2f63099f78adbd68117894473f21ed9dfc2c5217a4
MD5 030d2116f69eb27f92b8ffc86daabebd
BLAKE2b-256 3b2add0e1e65a7b7d196d3114b3b1819c329f5576282cf377b55376572b84455

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: asammdf-7.4.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 833.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1fb96492e4fbb764b01d9dce17e3ca036f6690651fb4d0c64004cb4a43447dd1
MD5 2c0e17284a9e9ce3bca35f4b662f04b9
BLAKE2b-256 a7ff2911dabd9ed4e62803d606e81dd24e66f0d88f060b789b19298b936d60e3

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9e5809e4bb20e0b7bfb9aae411a1088f93176d7dbf59fb6023e4f57da6ff958
MD5 e17ebc4534085394778a115ae9b42bf8
BLAKE2b-256 4dcf2ee738d80bf711e2b6e78ef59383036f7dfdf87abf8efeb6aac91efc35ef

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3523a2e8297748e43fff809964ecf7fd8053566efa48dfb7a75bfd584d45cef3
MD5 440e63c601ca890c6a29764bd7b8c6e2
BLAKE2b-256 0a5a8662bdf8a2fe0accde43d9011f5a7d3de47fce842ec59da61e8f3233456c

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: asammdf-7.4.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 833.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 15544078c17ea5718484f233bafcdcaedea2a3773e22c1589afde657478745d5
MD5 874fcd96d2dba6ef9e7810768dd63cb6
BLAKE2b-256 8fc3942fa05153fe9b28a17806ac51e82cf81991b2adeca7b800d23abd37a8ee

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 50c37645eb54ed96d06a677a4b021b68d60c53436d12e07e27dda1a28bce5d08
MD5 29234e08de1db2b8eee6df0eb5bc4614
BLAKE2b-256 c5e807f3c1b1fa7c203ed122ef6a2125ae9880c0690d9fd2f2c40b3204c49d8c

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c85d1136ccce61bec6e39df06075f99bf36b46ac6c83b54065f4e545dd690130
MD5 d8668f9c516db608eccdcc94a3630728
BLAKE2b-256 8ff6b30902e2ab38632bc6fb9651411dc067e06de44da1cdf94ff8dec3766cc0

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: asammdf-7.4.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 833.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8dccc6989108873fc0043feba3b078c81dbadd9cd6edc20d81d9f6fd8470f863
MD5 b5142d9ebc19fa2125dc0af4d41c4775
BLAKE2b-256 8d47784abda660801ab95b171f71bfd8b8af57611e288fc1baf54ef421375df9

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8448e2aee40fb2509fe1e4ec88c1ef861e95c35deafa1df595f4e5a1cb3a7c6a
MD5 a1f8e53633449beaa7676c4975dc0cba
BLAKE2b-256 c0c5e4d34177218f782e581212dff303ad1108d01e05bfd842abd6754c25a468

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d6e10232bb1b35c90e0f1f0c72a5562f45c23e6035046d631eea67c2d6d88b9
MD5 9599f69167266312139c62408bf24f62
BLAKE2b-256 ce7e2b6977fa09d8fe044e2bae82f955a8e7504c00f4c8e1d3a21fc7b04d4e4a

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: asammdf-7.4.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 833.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 29383a0e49d5faf46f4b2d7730b576f42b34c08e68ac1089c49d297ad68b8cb1
MD5 d2ea9b5ae33c1b6575bc003229acbf53
BLAKE2b-256 f0162bb495db07cec4fbacb157b7fcf749fd3b6cfaf063376134cd6a9a9ccdf2

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b1d178b9364d0123fd684637652ceddc796366730fd5e0e652d76c0dceb653e0
MD5 d1c84bff9310b6e66fe7038fb31b3943
BLAKE2b-256 1aabcaa2c809ff3cec7ffba9a48ca49e683d0f894aa985e1be32c0f0dbe95339

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 edad2ffb9d83c1d381327acfd6cf10e6336e45853a0adc6fdaaf0eaa3ba7ac65
MD5 57b6425864f9c688cd55e99ac685d69f
BLAKE2b-256 0fe7571ccd9a29e64b3f61e8ed0c8a64a8aeb9f078003444c809008a7a2cb313

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: asammdf-7.4.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 833.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for asammdf-7.4.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e5f7e4084c35259e9be33e2893adfe181b067c813d95bd2c6135aacc3b88d56d
MD5 56059865ace1091142a5d402cfea5a8a
BLAKE2b-256 68c5aad4a996e77a83dc869e0f54d35b6e00db56fceb2587b03d954ae4dec0a5

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 81ff7cbafd72e190838d9895b6e6b32a30b44fb3a18aadc99adbbe2f532f468a
MD5 c1e4b5888e4bf0b2086671dfd4eb459d
BLAKE2b-256 dce01da6067ae77b0ef2b2aa8a8026fd0baf40efd6f0f8ec797abb901366f522

See more details on using hashes here.

File details

Details for the file asammdf-7.4.5-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asammdf-7.4.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c6a62b2a4350b14cfc92aa3e8b4f404afcf79f7d275f1fa1644519d1239dd14
MD5 843aa5a37f18c6365a83da6678396f76
BLAKE2b-256 8ef334b52bd1545992ad50c4fb933dee80918f1c682126b25cd10697391c9263

See more details on using hashes here.

Supported by

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