tecio.plt.Read#
- class tecio.plt.Read#
Bases:
objectRead data from Tecplot PLT (
.plt) binary files.This class provides the exact same public API as
szl.Readso that the two can be used interchangeably.Zone metadata is parsed eagerly during
__init__; variable data is read lazily from disk when accessed viaReadVariable.valuesorReadVariable.get_values().- Parameters:
file_name – Path to the
.pltfile.- Raises:
PltReadError – If the file cannot be parsed as a valid PLT binary.
Example
from tecio import plt
r = plt.Read(“flow.plt”) print(r.title) print(r.num_vars)
zone = r.zone[0] pressure = zone.variable[2].values # NumPy array, read from disk now
- __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#
Dataset-level auxiliary data.
- property file_type#
File type (FULL, GRID, or SOLUTION).
- get_var_auxdata(var_index)[source]#
Return auxiliary data for variable var_index (1-based).
- Raises:
IndexError – If var_index is outside
[1, num_vars].
- get_zone_auxdata(zone_index)[source]#
Return auxiliary data for zone zone_index (1-based).
- Raises:
IndexError – If zone_index is outside
[1, num_zones].
- property num_auxdata_items#
Number of dataset-level auxiliary data items.
- property num_vars#
Number of variables in the dataset.
- property num_zones#
Number of zones in the dataset.
- property title#
Dataset title string.
- property var_auxdata#
List of per-variable auxiliary data objects.
Index 0 is
None(placeholder) so that 1-based indexing matches Tecplot convention; usevar_auxdata[1]for the first variable.
- property variables#
List of variable name strings.