I want to filter MF4 files using a signal list and import them into CANoe. For filtering I use the following asammdf code:
from asammdf import MDF
import re
channels_to_keep=[]
filter = open(signallist.lab,'r')
inputMF4 = bigData.MF4
mdf = MDF(inputMF4)
all_channels = mdf.channels_db
for row in filter:
row = re.sub('\n', '', zeile)
if row in all_channels:
channels_to_keep.append(zeile)
new_mdf = list(filter(None, channels_to_keep))
mdf.filter(new_mdf).save(dst='smallData.MF4')
I can't import the new File in CANoe (Maybe he looses Metadata?) However i can open the File in CANape and see all Channels.
if i just cut the origin File in smaller Pieces using:
short=mdf.cut(start=starttime, include_ends = True)
short.save()
then i can import the File like always.
Why does asammdf lose information, or rather how can I filter by Channels and import the new file?
Is it possible that asammdf exports a signal-based MF4 by default?