tecio.dat.Read#

class tecio.dat.Read#

Bases: object

Read a Tecplot ASCII DAT file into memory.

The entire file is parsed on construction. All data is then available through the same attributes and methods as szl.Read.

Example

>>> dat = Read("Onera.dat")
>>> dat = tecio.open("Onera.dat", "r")
Parameters:

path (str) – Path to the .dat file.

Raises:
__enter__()[source]#

Context manager for Read class.

__exit__(exc_type, exc_val, exc_tb)[source]#

Context manager protocol for read-only file interfaces.

Read classes hold no open file handle between accesses, so there is nothing to release on exit. Provided for API consistency with the Write classes and to support the with tecio.open(...) as r: pattern.

__init__(path)[source]#
__repr__()[source]#

Set a nice repr string for the read object.

property auxdata#

Return the dataset-level ReadAuxData container.

property file_type#

Return FileType enum for this file.

get_var_auxdata(var_index)[source]#

Return auxiliary data for variable var_index (1-based).

Example

>>> aux = dat.get_var_auxdata(1)
Raises:

IndexError – If var_index is out of range.

get_zone_auxdata(zone_index)[source]#

Return auxiliary data for zone zone_index (1-based).

Example

>>> aux = dat.get_zone_auxdata(1)
Raises:

IndexError – If zone_index is out of range.

property num_auxdata_items#

Return the number of dataset-level auxiliary data items.

property num_vars#

Return the number of variables in the dataset.

property num_zones#

Return the number of zones in the file.

property title#

Return the dataset title string.

property var_auxdata#

Return the per-variable aux data list (index 0 is None).

property variables#

Return the ordered list of variable name strings.

property zone#

Zones in this file, by index or slice.