tecio.cli.tecfix#
Rewrite a Tecplot data file with invalid variable arrays set to passive.
Numerical solvers occasionally produce output containing NaN or Inf values,
whether due to localised solver divergence, incomplete initialisation, or variables that
are formally undefined in certain zones. These invalid values propagate silently
through post-processing pipelines and can cause unexpected behaviour in Tecplot and
downstream tools. tecfix addresses this by scanning every variable array in a file
and rewriting any array containing invalid values as passive, recording the affected
variable names in zone-level auxiliary data for traceability. A dry-run mode is
available to produce a diagnostic report without writing any output, making the tool
useful as a validation step before committing to a fix.
- Usage:
tecfix [-h] [-o PATH] [-f] [--dry-run] PATH
- Positional Arguments:
filenamePath to the input Tecplot binary file (
.pltor.szplt) to inspect and fix.
- Options:
-o PATH,--output PATHOutput file path. Defaults to
<stem>_fixed<ext>in the same directory as the input file.-f,--forceOverwrite the output file if it already exists. Without this flag the command exits with an error rather than silently clobbering an existing file.
--dry-runScan all variable arrays for invalid values and print a report without writing any output file. Useful for diagnosing whether a file requires fixing before modifying it.
- Returns:
A new Tecplot file written to the output path with all invalid variable arrays set to passive. Affected variables are recorded in zone-level auxiliary data. If
--dry-runis set, output is written to standard output only and no file is produced. Exit code is0on success and non-zero if the input file cannot be read or the output file already exists and--forceis not set.
Examples
Fix a file with the default output naming:
$ tecfix flow.szplt
Write the fixed file to an explicit path:
$ tecfix flow.szplt --output clean.szplt
Overwrite an existing fixed file:
$ tecfix --force flow.szplt
Report bad variables without writing any output:
$ tecfix --dry-run flow.szplt
Call directly from a Python session:
import tecio.cli.tecfix.main as tecfix
tecfix(["flow.szplt", "--output", "clean.szplt"])
See also
tecio.cli.tecdump: Inspect file contents and metadata to identify zones or variables that may require fixing.tecio.cli.tecstats: Compute per-zone min, max, and mean statistics without printing raw values.
Note
Only floating-point variables (FLOAT and DOUBLE) are inspected;
integer variables cannot represent NaN / Inf and are always copied as-is.
Note
Variables that are already passive or shared in the source file are forwarded unchanged (they remain passive / shared).
Note
If a zone has no bad variables its aux data is not modified beyond what was already present in the source file.
Note
The output format matches the input format (extension is preserved).
Functions
|
Inspect and fix a Tecplot file. |