Reading mf4 data through asammdf and getting unexpected data structure

255 views Asked by At

I am relatively new to python and am trying to do some data post-processing through it. I am using the asammdf library to read an mf4 file. I can perfectly open it with NI DIAdem, therefore I know that the data is in there. Unfortunately, in Python the data structure looks very weird, it seems to me like there is only one timestamp for each channel. I suspect that I am missing something in how I should import mf4 files with asammdf, but being relatively new to the library I am a bit clueless at the moment. Can anyone help?

Code to import the file is simply:

mdf = MDF('FileName')

The structure of the data can be seen in the picture

1

There are 1 answers

2
danielhrisca On

You should use get or select to extract the signals from the measurement

m = MDF('filename')
altitude = m.get('Altitude_WGS84')
print(altittude, altitude.samples, altitude.timestamps)

See the documentation https://asammdf.readthedocs.io/en/latest/api.html#mdf4