tecio.cli.tecstats#
Print per-variable statistics for a Tecplot data file.
Verifying that simulation output is physically reasonable, falls within expected bounds,
or that a variable has not collapsed to a constant is a routine step in CFD
post-processing. Extracting these figures from a binary file would otherwise require
opening it in Tecplot or writing a dedicated script. tecstats reports the minimum,
maximum, mean, and standard deviation for every variable in every zone directly to the
terminal, with optional CSV output for further analysis or archival. Passive and shared
variables are noted but skipped. Used alongside tecfix, this tool provides a
lightweight diagnostic layer for validating file contents before and after any
corrective operation.
- Usage:
tecstats [-h] [-zone INDEX] [-variable INDEX] [-csv] [-f] PATH
- Positional Arguments:
PATHPath to the input Tecplot file (
.plt,.szplt, or.dat) to analyse.
- Options:
-zone INDEXRestrict output to the zone at the given one-based index. If omitted, all zones are reported.
-variable INDEXRestrict output to the variable at the given one-based index. If omitted, all variables are reported.
-csvWrite statistics to a CSV file in addition to the terminal output. The filename is derived automatically from the input file stem with a
_statssuffix, preceded by optional_zone_Nand_var_Nsegments when the corresponding filters are active. For example:Command
Output filename
tecstats -csv flow.szpltflow_stats.csvtecstats -csv -zone 2 flow.szpltflow_zone_2_stats.csvtecstats -csv -variable 3 flow.szpltflow_var_3_stats.csvtecstats -csv -zone 2 -variable 3 flow.szpltflow_zone_2_var_3_stats.csv-f,--forceOverwrite the output CSV file if it already exists. Without this flag the command exits with an error rather than silently clobbering an existing file.
- Returns:
Statistics are written to standard output. If
-csvis set, a CSV file is also written to the same directory as the input file with an automatically derived name. Exit code is0on success and non-zero if the input file cannot be read, an invalid index is supplied, or the CSV file already exists and--forceis not set.
Examples
Print statistics for all zones and variables:
$ tecstats flow.szplt
Restrict to zone 2 only:
$ tecstats -zone 2 flow.szplt
Restrict to variable 3 across all zones:
$ tecstats -variable 3 flow.szplt
Write results to a CSV file:
$ tecstats -csv flow.szplt
Call directly from a Python session:
import tecio.cli.tecstats.main as tecstats
tecstats(["-zone", "2", "-variable", "3", "flow.szplt"])
See also
tecio.cli.tecdump: Inspect the full contents and metadata of a file, including auxiliary data and raw variable arrays.tecio.cli.tecfix: Rewrite a file with invalid variable arrays set topassive once bad values have been identified via statistics.
Functions
|
Print per-variable statistics for a Tecplot file. |