ratal / mdfreader

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

Access only one channel of mdf file #126

Closed danielsci closed 6 years ago

danielsci commented 6 years ago

With yop=mdfreader.mdf('NameOfFile') all measurement Channels are loaded. Is it possible to load one channel or a list of channels. That can be useful for a certain analysis method that need only the values of one channel. Thank you !

cristi-neagu commented 6 years ago

You can use yop = mdfreader.mdf(filename, channelList=['channel1', 'channel2',...]. This is slower than reading the entire file, but saves memory. What are you trying to save? Time or memory?

danielsci commented 6 years ago

Thank you. It works. If all Channels are imported the warning Failed to convert text to range table occurs.

ratal commented 6 years ago

Hi Daniel, If you want to persevere: line 269 in function textRangeTableConv of mdf3reader.py is generating this print. Removing the try will allow to understand the error. You could print the channel name as well by adding a print(channelName) line 1036 when this function is called. To better understand, you can also have a look at your file with MDFValidator from Vector and check the conversion block structure that could be exotic.

danielsci commented 6 years ago

Hi Aymeric,

today I fortunately spent time on my python script. I found out that a conversion of those signals is not necessary. So the mdfreader keeps the values in this case.

ratal commented 6 years ago

Hi Daniel, What do you mean, conversion of signals is not necessary ? Did you use convertAfterRead=False argument ?

ratal commented 6 years ago

About 2 months without feedback, closing. Do not hesitate to repoen.