Measured Data Format blocks paser for version 4.x
With Unix and Windows for python 2.6+ and 3.2+
Created on Sun Dec 15 12:57:28 2013
Author: | Aymeric Rateau |
---|
Bases: mdfinfo4.MDFBlock
reads Attachment block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Channel Array block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Channel Conversion block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Channel Group block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Channel Hierarchy block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Channel block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Comment block and saves in class dict
Notes
Can read xml (MD metadata) or text (TX) comments from several kind of blocks
Methods
Extract Xml field from a xml tree
Parameters: | xml_tree : xml tree from xml.etree.ElementTree field : str |
---|---|
Returns: | field value in xml tree |
Bases: mdfinfo4.MDFBlock
reads Data Group block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Event block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads File History block and save in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Header block and save in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads ID Block and save in class dict
Methods
Bases: dict
MDFBlock base class for the MDF related block classes
Methods
loadHeader(fid, pointer) | reads block’s header and put in class dict |
mdfblockread( fid, type, count ) | converts a byte array of length count to a given data type |
mdfblockreadCHAR( fid, count ) | reads a character chain of length count encoded in latin. |
mdfblockreadBYTE( fid, count ) | reads an array of UTF-8 encoded bytes |
reads block’s header and put in class dict
Parameters: | fid : float
pointer : int
|
---|
converts a byte array of length count to a given data type
Parameters: | type : str
count : int
|
---|---|
Returns: | array of values of ‘type’ parameter |
reads an array of UTF-8 encoded bytes. Removes trailing 0
Parameters: | count : int
|
---|---|
Returns: | bytes array of length count |
reads a character chain of length count encoded in latin. Removes trailing 0
Parameters: | count : int
|
---|---|
Returns: | a string of length count |
Bases: mdfinfo4.MDFBlock
reads Source Information block and saves in class dict
Methods
Bases: mdfinfo4.MDFBlock
reads Sample Reduction block and saves in class dict
Methods
converts xml tree into dictionnary
Parameters: | element : xml tree from xml.etree.ElementTree |
---|---|
Returns: | dict of xml tree flattened |
Bases: dict
information block parser fo MDF file version 4.x
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. Either file name or fid should be given. General dictionary structure is the following
Attributes
fileName | (str) name of file |
Methods
Read MDF file and extract its complete structure
Parameters: | fileName : str
|
---|---|
Returns: | list of channel names contained in file |
reads Attachment blocks
Parameters: | fid : float
pointer : int
|
---|---|
Returns: | Attachments Blocks in a dict |
reads Channel Group blocks
Parameters: | fid : float
dg : int
channelNameList : bool
|
---|
reads Channel blocks
Parameters: | fid : float
dg : int
cg : int
channelNameList : bool
|
---|
check for composition of channels, arrays or structures
Parameters: | fid : float
dg : int
cg : int
MLSDChannels : list of int
channelNameList : bool
|
---|---|
Returns: | MLSDChannels list of appended Maximum Length Sampling Data channels |
reads Data Group Blocks
Parameters: | fid : float
channelNameList : bool
|
---|
reads Sample Reduction Blocks
Parameters: | fid : float
pointer : int
|
---|---|
Returns: | Sample Reduction Blocks in a dict |
read all file blocks except data
Parameters: | fid : float
|
---|