Skip to main content

Read and convert Mechbase files (.dr) to known file formats

Project description

DR Files

Read and convert MECHBASE files (.dr) to known file formats

MECHBASE

MECHBASE® is a complete preventive solution that was developed by Arpedon, P.C., in order to help you store and trend your equipment status.

MECHBASE files format

MECHBASE files have the following structure:

  • 2 bytes - the size of the header in bytes, in little-endian short integer format
  • next N bytes - the header, in this protobuf format
  • remaining bytes - the values of the signals, with each value represented in 2 bytes, like below (signal has 3 channels in this example):
    • next 2 bytes - first value of the first channel, in little-endian short integer format
    • next 2 bytes - first value of the second channel, in little-endian short integer format
    • next 2 bytes - first value of the third channel, in little-endian short integer format
    • next 2 bytes - second value of the first channel, in little-endian short integer format
    • next 2 bytes - second value of the second channel, in little-endian short integer format
    • next 2 bytes - second value of the third channel, in little-endian short integer format
    • ...

Converting values to actual measured values

  • divide the value by the maximum short value (32767)
  • multiply the value with the channel reference value
  • add the channel offset to the value
  • multiply the value with 1000 and divide by the channel sensitivity value
  • if channel db_reference exists and is positive
    • multiply the log10 of the absolute value divided by the db_reference with 20 - 20 * log10(abs(value) / db_reference)
    • add the channel pregain to the value

Reference code can be found in the value_converter function.

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

dr_files-0.1.6.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

dr_files-0.1.6-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file dr_files-0.1.6.tar.gz.

File metadata

  • Download URL: dr_files-0.1.6.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for dr_files-0.1.6.tar.gz
Algorithm Hash digest
SHA256 34dfde721a1f8df68ab14200159dab9287bf88f3602f74aa48adc23f75a5e3bd
MD5 80e5ced325ed18e6c202b7d224de97f3
BLAKE2b-256 8e1b379fbabf3531b0ee394bdd8b2b910ae2eaeb941a34872e7447bec5a8c21d

See more details on using hashes here.

File details

Details for the file dr_files-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: dr_files-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for dr_files-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a7be9591d16d74e1c8fd0229bca37ea7cddb3b1f8572193b0fba1703d0b26041
MD5 7a2e3909586a899d60a746fbf9612442
BLAKE2b-256 95534303d7790fd6531904edfd97ddbf50206b5b46af451075cdbdd442ab422e

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