tdm_loader

Contents:

class tdm_loader.tdm_loader.OpenFile(tdm_path, tdx_path='', encoding='utf-8')

Class for opening a National Instruments TDM/TDX file.

tdm_path : str
The full path to the .TDM file.
tdx_path : str, Optional
The full path to the .TDX file. If not present, it will be assumed the TDX file is located in the same directory as the .TDM file, and the filename specified in the .TDM file will be used.
channel(channel_group, channel, occurrence=0, ch_occurrence=0)

Returns a data channel by its channel group and channel index.

channel_group : int or str
The index or name of the channel group.
channel : int or str
The index or name of the channel inside the group.
occurrence : int, Optional
Gives the nth occurence of the channel group name. By default the first occurence is returned. This parameter is only used when channel_group is given as a string.
ch_occurrence : int, Optional
Gives the nth occurence of the channel name. By default the first occurence is returned. This parameter is only used when channel_group is given as a string.
channel_dict(channel_group, occurrence=0)

Returns a dict representation of a channel group.

channel_group : int or str
The index or name of the channel group.
occurrence : int
Gives the nth occurrence of the channel group name. By default the first occurrence is returned. This parameter is only used when channel_group is given as a string.
channel_group_index(channel_group_name, occurrence=0)

Returns the index of a channel group with the given name.

channel_group_name : str
The name of the channel group.
occurrence : int, Optional
Gives the nth occurrence of the channel group name. By default the first occurrence is returned.
channel_group_name(channel_group)

Returns the name of the channel group at the channel group index.

channel_group : int
The index of the channel group.

Returns a list of channel group names that contain search term. Results are independent of case and spaces in the channel name.

search_term : str
The term to search for in the channel group names
found_terms : list of (str, int)
Returns the found channel group names as tuple of full name and channel group index.
channel_name(channel_group, channel)

Returns the name of the channel at given channel group and channel indices.

channel_group : int
The index of the channel group.
channel : int or str
The index or name of the channel inside the group.

Returns a list of channel names that contain search term. Results are independent of case and spaces in the channel name.

search_term : str
The term to search for in the channel names
return_column : bool
If True the function returns the column index instead of channel group and channel indices
found_terms : list of (str, int, int) or list of (str, int) (latter case for return_column = True)
Returns the found channel names as tuple of full name and column index or channel group and channel indices depending on the value of return_column.
channel_unit(channel_group, channel)

Returns the unit of the channel at given channel group and channel indices.

channel_group : int
The index of the channel group.
channel : int or str
The index or name of the channel inside the group.
close()

Close the file.

col(column_number)

Returns a data column by its index number.

get_channel_indices(column_index)

Returns the channel group and channel indices of given column index.

column_index : int
The index of the column.
get_column_index(channel_group, channel, occurrence=0)

Returns the column index of given channel group and channel indices.

channel_group : int
The index of the channel group.
channel : int or str
The index or name of the channel inside the group.
no_channel_groups()

Returns the total number of channel groups.

no_channels(channel_group)

Returns the total number of channels inside the given channel group.

channel_group : int
The index of the channel group.
plot_channels(x, ys)

Plot multiple channels.

x : (int, int)
The channel group / channel indices combination of a single channel to plot on the x-axis.
ys : list of (int, int)
A list of multiple channel group / channel indices to plot on the y-axis.
class tdm_loader.tdm_loader.ReadTDM(tdm_path, encoding='utf-8')

Class for parsing and storing data from a .TDM file.

tdm_path : str
The full path to the .TDM file.

Indices and tables