mdfinfo3 module documentation¶
Measured Data Format blocks parser for version 3.x
Created on Thu Dec 9 12:57:28 2014
Dependencies¶
- Python >2.6, >3.2 <http://www.python.org>
- Numpy >1.6 <http://numpy.scipy.org>
Attributes¶
- PythonVersion : float
- Python version currently running, needed for compatibility of both python 2.6+ and 3.2+
mdfinfo3 module¶
-
class
mdfinfo3.
info3
(fileName=None, fid=None, filterChannelNames=False)¶ Bases:
dict
mdf file info class version 3.x MDFINFO is a class information about an MDF (Measure Data Format) file Based on following specification http://powertrainnvh.com/nvh/MDFspecificationv03.pdf
Notes
mdfinfo(FILENAME) contains a dict of structures, for each data group, containing key information about all channels in each group. FILENAME is a string that specifies the name of the MDF file. General dictionary structure is the following
- mdfinfo[‘HDBlock’] header block
- mdfinfo[‘DGBlock’][dataGroup] Data Group block
- mdfinfo[‘CGBlock’][dataGroup][channelGroup] Channel Group block
- mdfinfo[‘CNBlock’][dataGroup][channelGroup][channel] Channel block including text blocks for comment and identifier
- mdfinfo[‘CCBlock’][dataGroup][channelGroup][channel] Channel conversion information
Attributes
filterChannelNames (bool, optional) flag to filter long channel names including module names separated by a ‘.’ fileName (str) name of file Methods
-
static
blockformats3
(block, version=0)¶ This function returns all the predefined formats for the different blocks in the MDF file
Parameters: block : str
kind of block
version : int
mdf version
Returns: nested list of str and int describing structure of block to be used by mdfblockread3 method
-
listChannels3
(fileName=None)¶ reads data, channel group and channel blocks to list channel names
Returns: list of channel names Attributes
fileName (str) file name
-
static
mdfblockread3
(blockFormat, fid, pointer, removeTrailing0=True)¶ Extract block of data from MDF file in original data types. Returns a dictionary with keys specified in data structure blockFormat
Parameters: blockFormat : nested list
output of blockformats3 method
fid : float
file identifier
pointer : int
position of block in file
removeTrailing0 : bool, optional
removes or not the trailing 0 from strings
Returns: Block content in a dict
-
readinfo3
(fid)¶ read all file blocks except data
Parameters: fid : float
file identifier