Channel Object References¶
- class comtrade.Channel(n=1, name='', ph='', ccbm='')¶
Holds common channel description data.
- class comtrade.StatusChannel(n: int, name='', ph='', ccbm='', y=0)¶
Holds status channel description data.
- class comtrade.AnalogChannel(n: int, a: float, b=0.0, skew=0.0, cmin=-32767, cmax=32767, name='', uu='', ph='', ccbm='', primary=1.0, secondary=1.0, pors='P')¶
Holds analog channel description data.
DatReader Object Reference¶
- class comtrade.DatReader(**kwargs)¶
Abstract DatReader class. Used to parse DAT file contents.
- Attributes:
total_samplesReturn the total samples (per channel).
Methods
load(dat_filepath, cfg, **kwargs)Load a DAT file and parse its contents.
parse(contents)Virtual method, parse DAT file contents.
read(dat_lines, cfg)Read a DAT file contents, expecting a list of string or FileIO object.
- load(dat_filepath, cfg, **kwargs)¶
Load a DAT file and parse its contents.
- parse(contents)¶
Virtual method, parse DAT file contents.
- read(dat_lines, cfg)¶
Read a DAT file contents, expecting a list of string or FileIO object.
- property total_samples¶
Return the total samples (per channel).
- class comtrade.AsciiDatReader(**kwargs)¶
ASCII format DatReader subclass.
- Attributes:
total_samplesReturn the total samples (per channel).
Methods
load(dat_filepath, cfg, **kwargs)Load a DAT file and parse its contents.
parse(contents)Parse a ASCII file contents.
read(dat_lines, cfg)Read a DAT file contents, expecting a list of string or FileIO object.
- parse(contents)¶
Parse a ASCII file contents.
- class comtrade.BinaryDatReader(**kwargs)¶
16-bit binary format DatReader subclass.
- Attributes:
total_samplesReturn the total samples (per channel).
Methods
load(dat_filepath, cfg, **kwargs)Load a DAT file and parse its contents.
parse(contents)Parse DAT binary file contents.
read(dat_lines, cfg)Read a DAT file contents, expecting a list of string or FileIO object.
get_reader_format
- parse(contents)¶
Parse DAT binary file contents.
- class comtrade.Binary32DatReader(**kwargs)¶
32-bit binary format DatReader subclass.
- Attributes:
total_samplesReturn the total samples (per channel).
Methods
load(dat_filepath, cfg, **kwargs)Load a DAT file and parse its contents.
parse(contents)Parse DAT binary file contents.
read(dat_lines, cfg)Read a DAT file contents, expecting a list of string or FileIO object.
get_reader_format
- class comtrade.Float32DatReader(**kwargs)¶
Single precision (float) binary format DatReader subclass.
- Attributes:
total_samplesReturn the total samples (per channel).
Methods
load(dat_filepath, cfg, **kwargs)Load a DAT file and parse its contents.
parse(contents)Parse DAT binary file contents.
read(dat_lines, cfg)Read a DAT file contents, expecting a list of string or FileIO object.
get_reader_format