ratal / mdfreader

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

Cannot read an unsorted file #71

Closed JulienGrv closed 6 years ago

JulienGrv commented 7 years ago

Hi Aymeric,

Hats off to your work on this mdfreader!

Now, I would like to let you know that your module doesn't work for an unsorted file. If you want to read every channel in an unsorted file, you can do it recursively based on the same way you are reading channel group (CG block). If a channel (CN block) is of type 8 (if I correctly remember) then it's a structure channel, it means it contains sub-channels (child CN block), you can view it as the same as a channel group (CG block). There is a section about structure channels on this page: https://wiki.asam.net/display/STANDARDS/ASAM+MDF

I wish I could submit myself a PR to solve this issue but I lack understandings of your code to do it yet. If I find a way, I may help you. Otherwise, I hope you can figure out a fix yourself.

Cheers, Julien.

ratal commented 7 years ago

Hi Julien, mdfreader should be working for unsorted files, both 4.x and recently 3.x (less mature). Do you have same issue with sorted file containing structures ? Can you share exact error stack you have ? To identify if a channel has a structure, the channel composition pointer should link to a channel group (not related to channel type, can be checked with mdfvalidator). Currently, mdfreader will handle channel arrays (that is a composition) but not structure channels, probably the error you are facing. It should be possible to add code like line 632 in mdf4reader dedicated to arrays but for strucutres. The thing is I do not have test files to confirm modifications would work for structures so if you can share a dummy file with this structure it would help. Otherwise, I coudl also more actively guide you in the code to make modifications and PRs. Regards Aymeric

ratal commented 6 years ago

No feedback since a month, closed. Do not hesitate to reopen.