danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
633 stars 224 forks source link

Asammdf cut function modifying signal values #1084

Open gauravnaik001 opened 11 hours ago

gauravnaik001 commented 11 hours ago

Python version

'python=3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]' 'os=Linux-5.15.0-1071-azure-x86_64-with-glibc2.35' 'numpy=1.23.5' 'asammdf=8.0.0'

MDF version

4.10

Code snippet

Cannot share the code unfortunately.

Traceback

No code error observed.

Description

We are using the asammdf cut function to cut the mf4 file based on the timestamps, once the file is cut we use the asammdf save function to save the cut files. When we read both the cut files, we observed that few of the signal values in one of the cut file were modified.

For example, given a mf4 file (containing a mixture of 10 hz and 1 hz signal data) containing multiple signals and timestamps from 0.0588730000000000 till 16906.0588730000017677. Using asammdf cut function, the file was cut from timestamp - 0.0588730000000000 to 8447.8588720000007015 to create the first file and timestamp - 8447.7500000000000000 to 16905.9588729999995849 to create the second file. We observed in the first cut file, for around 4-5 signals, the values were changed/modified. Ex, the float signal values which were previously 7.0 is changed to 0.0, the string values are changed to null. We checked this for different version of asammdf, the result is the same. For different mf4 file, the signals which get modified are different, but always the file which is cut where the start = None and end = random timestamp(which is not None) is the file where the signals are modified.

This does not happen if the file is cut and both the start and stop timestamp is None, here the signal values are not modified, but the channel object containing the lower_limit and upper_limit values are reset to 0.

Please let me know if you need any more information.

danielhrisca commented 10 hours ago

please send a demo file, the cut arguments and the signal name