danielhrisca / asammdf

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

Recorder_time reads wrongly in mdf4 with version : asammdf==7.3.12 #1099

Closed parthipan-ganeshaperumal closed 1 week ago

parthipan-ganeshaperumal commented 1 week ago

Python version

Please run the following snippet and write the output here

import platform
import sys
from pprint import pprint

pprint("python=" + sys.version)
pprint("os=" + platform.platform())

output of above : 
('python=3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 '
 'bit (AMD64)]')
'os=Windows-10-10.0.19045-SP0'

try:
    import numpy
    pprint("numpy=" + numpy.__version__)
except ImportError:
    pass

output of above : 
'numpy=1.24.3'

try:
    import asammdf
    pprint("asammdf=" + asammdf.__version__)
except ImportError:
    pass

output of above : 
'asammdf=7.3.12'

Code

MDF version

_please write here the file version (you can run print(MDF(file).version))

mdf.version '4.10'

Code snippet

please write here the code snippet that triggers the error

Traceback

please write here the error traceback

Description

Original recorder_time on Group (6) which is belongs to mdf4 file is (below) - try to look samples: (below one took from valid asammdf version : 'asammdf=5.12.0'

mdf.get('recorder_time', group=6, index=0) enter conversion:None type of modified conversion:<class 'NoneType'> <Signal recorder_time: samples=[1.0454007e+00 1.1454007e+00 1.2454007e+00 ... 1.5409454e+03 1.5410454e+03 1.5411454e+03] timestamps=[1.0454007e+00 1.1454007e+00 1.2454007e+00 ... 1.5409454e+03 1.5410454e+03 1.5411454e+03] invalidation_bits=None unit="s" conversion=None source=SignalSource(name='Measurement', path='MEAS[1]', comment='', source_type=0, bus_type=0) comment="" mastermeta="('recorder_time', 1)" raw=False display_name= attachment=()>

ISSUE : Same in ASAMMDF=7.3.12 based mdf : (try to look sampes)

mdf.get('recorder_time', group=6, index=0) <Signal recorder_time: samples=[ 1.14994077 1.15994077 1.16994077 ... 155.13994077 155.14994077 155.15994077] timestamps=[1.0454007e+00 1.1454007e+00 1.2454007e+00 ... 1.5409454e+03 1.5410454e+03 1.5411454e+03] invalidation_bits=None unit="s" conversion=None source=<asammdf.blocks.source_utils.Source object at 0x000002472616A9D0> comment="" flags="0" mastermeta="('recorder_time', 1)" raw=False display_names={} attachment=None>

Additional Reference: Particular channel conversion info: (means group=6, index=0)

print(mdf.groups[6].channels[0].conversion)

<ChannelConversion (name: , unit: , comment: , formula: , referenced blocks: None, address: 89256, fields: ['_cache:None', 'a:0.1', 'address:89256', 'b:1.0454007', 'block_len:96', 'comment:', 'comment_addr:0', 'conversion_type:1', 'flags:0', 'formula:', "id:b'##CC'", 'inv_conv_addr:0', 'is_user_defined:False', 'links_nr:4', 'max_phy_value:0.0', 'min_phy_value:0.0', 'name:', 'name_addr:0', 'precision:0', 'ref_param_nr:0', 'referenced_blocks:None', 'reserved0:0', 'unit:', 'unit_addr:0', 'val_param_nr:2'])>

Kindly suggest why sampled of recorder_time looks different compare to original onle

parthipan-ganeshaperumal commented 1 week ago

I got a picture to solve like avoiding default conversion formula will give raw data true , Kindly close .. no need further analyze here .. Thanks