danielhrisca / asammdf

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

Concatenate issue due to empty channel groups #988

Open JianquanW opened 4 months ago

JianquanW commented 4 months ago

Hallo, I am concatenating 2 MDf files. They are almost same, one of them has 1 more channel group which has 2 channels. I try to select same channels when I read them, but as there still exists an empty channel group, then the concantenation can not work. How can I delete the empty channel group or resolve this problem by other way? Thank you very much.😁 Respect 🫡 ` from asammdf import MDF from select_channel import channels_for_select

mdf1 = MDF('Data1.mf4',channel) mdf2 = MDF('Data2.mf4')

mdf_concatenated = MDF.concatenate([mdf1,mdf2])

mdf_concatenated.save('mdf_res.mf4') `

JianquanW commented 4 months ago

I successfully made concatenation by using get_group and append groups into another MDF. But I wish there can be a property that can delete group directly. Thank you for your great job, Mr. Daniel.

danielhrisca commented 4 months ago

mdf.groups is a list that you edit and pop the groups that are not needed

JianquanW commented 4 months ago

After so many attempt, I found that not only the mdf.groups need to be changed ,but also the mdf.vitual_groups need to be changed. Then the concatenation can be made.