I have a python script that aims to remove "missing values" from certain timestamps and variables.
I have not written this script myself and I'm trying to understand it.
The script basically copies all channels and signals from the original MDF file to a new one, not changing any values. However, after running the script all missing values are removed from the new MDF File. I am confused as to how this is done, as this seems to be done implicitly by the asammdf library.
Here is the important code:
To create my mdf file: `mdf_org = MDF(os.path.abspath(os.path.join(data_folder,file)))`
new_file_name = str(file) + "_Signals_fixed" + ".MF4"
new_mdf_file = MDF(Version = mdf_org.version, filename = new_file_name, backend= 'hdf')
channel_name_list =[]
for channel in mdf_org.iter_channels():
channel_name_list.append(channel.name)
#print(channel_name_list)
signals = mdf_org.select(channels= channel_name_list,ignore_value2text_conversions = True)
mdf = MDF(Version = mdf_org.version)
for s in signals:
mdf.append(s)
for channel_name in channel_name_list:
Singal_to_be_fixed = mdf.get(channel_name)
New_Signal_fixed = Singal_to_be_fixed
new_mdf_file.append(New_Signal_fixed)
new_mdf_file.save(new_file_name,0,compression = 1)
Tried changing the ingore_value2text_conversions to False and True, seeing if that is the cause.