ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 73 forks source link

Could not keep the original data format with 'mdfreader.write' #186

Closed likunjay1986 closed 3 years ago

likunjay1986 commented 4 years ago

Python version

python 3.7.0.64

Platform information

Windows7

Numpy version

1.18.5

mdfreader version

3.3

Description

When working with the 'dat' format data recorded by INCA, I find that part of information is lost if I use the mdfreader method 'write'. For example:

  1. Information of 'unit' are all lost
  2. The _'Bool'_ data is converted to 'int'_
ratal commented 4 years ago

a boolean in a PC is an integer of 8bits, same. mdfreader's write method does not embed bits in bytes, so will take a bit more space but will be quicker to read. It is also more complicated to code the writer, so did not do. Regarding the unit, write() method should write units. Could be a bug. It is around line 1339 of mdf3reader.py, you could debug there and understand what is happening but first thing to check is if you can read the units before trying to write them.

ratal commented 3 years ago

No feedback since almost 6 months, closing but do not hesitate to reopen if needed