tecio.dat.Read#
- class tecio.dat.Read#
Bases:
objectRead 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
.datfile.- Raises:
FileNotFoundError – If path does not exist.
ValueError – On unsupported format features.
- __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.
- property auxdata#
Return the dataset-level
ReadAuxDatacontainer.
- property file_type#
Return
FileTypeenum 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_indexis 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_indexis 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.