tecio.AppendReadWrite#
- class tecio.AppendReadWrite#
Bases:
AppendWriteRead + write handle returned by
tecio.open()withmode='a+'.Inherits all write methods from
AppendWriteand additionally exposes the full read interface populated from the original file. The read data reflects the file as it existed before any new zones were appended — zones written during the current session are not visible viazoneuntil the file is closed and re-opened.Useful when new zones depend on existing zone data — for example, computing a time-average over all previous time steps and writing it as an additional zone.
Do not instantiate this class directly — use
tecio.open().Example
>>> with tecio.open("flow.szplt", "a+") as tec: ... # Read from all zones present before this session ... times = [tec.zone[i].solution_time for i in range(tec.num_zones)] ... p_avg = ( ... sum(tec.zone[i].variable["p"].values for i in range(tec.num_zones)) ... / tec.num_zones ... ) ... ... # Append a new zone using the computed average ... x = tec.zone[0].variable["x"].values ... y = tec.zone[0].variable["y"].values ... tec.write_ijk_zone( ... data=[x, y, p_avg], ... title="Time-average", ... solution_time=max(times) + 1.0, ... strand_id=2, ... )
- property auxdata#
Dataset-level auxiliary data from the original file.
- property file_type#
File type of the original file (FULL / GRID / SOLUTION).
- property num_auxdata_items#
Number of dataset-level aux data items in the original file.
- property num_vars#
Number of variables in the original file.
- property num_zones#
Number of zones in the original file (before appending).
- property var_auxdata#
Per-variable auxiliary data list from the original file.
- property zone#
Zone list from the original file.