tecio.TecplotZoneReader#
- class tecio.TecplotZoneReader(zone_index, title, zone_type, solution_time, strand_id, datapacking)#
Bases:
ABCRead-only handle to one zone’s metadata in an open Tecplot file.
This is the common base for
TecplotOrderedZoneReaderandTecplotFEZoneReader. Only properties that mean the same thing for every zone topology live here, dimensions, node maps, and everything else that’s specific to one topology live on the corresponding subclass instead, so accessing e.g..node_mapon an ordered zone is a plainAttributeErrorrather than a silentNone.Scalar metadata (title, zone type, solution time, strand ID, datapacking) is resolved once at construction and frozen. The variable list and aux data stay lazily loaded on first access, since either can be large enough that eagerly building them for every zone in a file would be wasteful.
- Parameters:
zone_index – 0-based zone index within the dataset.
title – Zone title.
zone_type – The zone’s
ZoneType.solution_time – Solution time, 0.0 for static data.
strand_id – Strand ID, 0 for static data.
datapacking – On-disk value layout. SZL and every PLT version from v107 onward always supply
BLOCK, those formats have no packing distinction on disk; the field exists purely so code can treat every zone uniformly regardless of source format. The legacy PLT v75 format is the one exception: it genuinely stores some zones interleaved by node/element (POINT/FEPOINT), reported here asPOINT.
Attributes
Zone-level auxiliary data.
On-disk value layout for this zone.
Solution time, 0.0 for static data.
Strand ID, 0 for static data.
Zone title string.
Variables in this zone, by 0-based index or exact name.
0-based zone index within the dataset.
The zone's
ZoneType.Methods
get_array(key)Return variable data array(s) for this zone.
True unless the zone reports itself disabled.
- property auxdata#
Zone-level auxiliary data.
- property datapacking#
On-disk value layout for this zone.
- get_array(key)[source]#
Return variable data array(s) for this zone.
A single key (0-based index or exact name) returns one array. A list of exact names returns a tuple of arrays in the order given:
p = zone.get_array("p") x, y, z = zone.get_array(["x", "y", "z"])
- Returns:
One array (or
Noneonly if the variable is passive) for a scalar key; a tuple of such arrays for a list of names.- Raises:
KeyError – If a name does not exist.
IndexError – If an index is out of range.
- is_enabled()[source]#
True unless the zone reports itself disabled.
Only SZL can report False here; PLT and DAT have no such flag.
- Returns:
bool –
Truewhenever called in the base class. SZL may reportFalse,but all other file formats will report
True.
- property solution_time#
Solution time, 0.0 for static data.
- property strand_id#
Strand ID, 0 for static data.
- property title#
Zone title string.
- property variables#
Variables in this zone, by 0-based index or exact name.
- property zone_index#
0-based zone index within the dataset.
- property zone_type#
The zone’s
ZoneType.