Data I/O
File readers and writers for the formats used by the LST workflow.
Fortran Binary (re-exported from cfd-io)
lst_tools re-exports the Fortran binary reader and writer used for solver
binary files from cfd-io:
See the cfd-io documentation for the full API.
Meanflow Binary
LastracReader
lst_tools.data_io.LastracReader
Bases: FortranBinaryReader
Fortran binary reader with LASTRAC mean-flow record helpers.
read_header
Read LASTRAC file header records.
Returns a dict with keys
title, n_station, igas, iunit, Pr, stat_pres, nsp
read_station_header
Read LASTRAC station header (two records).
Returns a dict with keys
i_loc, n_eta, s, lref, re1, kappa, rloc, drdx, stat_temp, stat_uvel, stat_dens
LastracWriter
lst_tools.data_io.LastracWriter
Bases: FortranBinaryWriter
Fortran binary writer with LASTRAC mean-flow record helpers.
write_header
write_header(title: str, n_station: int, igas: int, iunit: int, Pr: float, stat_pres: float, nsp: int) -> None
Write LASTRAC file header records.
Flow Conditions
read_flow_conditions
lst_tools.data_io.read_flow_conditions
Read legacy flow_conditions.dat and return a dict of SI flow conditions.
Only extracts the first numeric value on each line. Unknown lines are ignored gracefully.
read_flow_conditions
Parse a legacy flow_conditions.dat and return a dict with keys compatible
with your config's flow_conditions section.
We favor the first numeric value on the line (expected SI). Lines with
multiple numbers like "ptot:
Parameters
fpath : str | Path Path to the flow_conditions.dat file.
Returns
dict[str, float] A mapping like: { "mach": 5.3, "re1": 1.79e7, "gamma": 1.4, "cp": 1005.0, "cv": 717.9, "rgas": 287.15, "pres_0": ..., "temp_0": ..., "pres_inf": ..., "temp_inf": ..., "dens_inf": ..., "uvel_inf": ... } Only keys that were found are returned.