tecio.plt.Read#

class tecio.plt.Read#

Bases: object

Read data from Tecplot PLT (.plt) binary files.

This class provides the exact same public API as szl.Read so that the two can be used interchangeably.

Zone metadata is parsed eagerly during __init__; variable data is read lazily from disk when accessed via ReadVariable.values or ReadVariable.get_values().

Parameters:

file_name – Path to the .plt file.

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

__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__(file_name)[source]#
__repr__()[source]#

Set a nice repr string for the read object.

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; use var_auxdata[1] for the first variable.

property variables#

List of variable name strings.