prometheus_equilibrium.tools.build_legacy_thermo

CLI for TERRA/AFCESIC parsing and AFCESIC calibration.

This consolidates one-off scripts into a single tool under prometheus.tools.

Subcommands:
terra

Parse terra.bas + terra_a.bas to terra.json.

afcesic-dump

Dump all AFCESIC binary records into a human-readable text file.

afcesic-calibrate

Parse and calibrate AFCESIC from DAT files to afcesic.json.

all

Run terra + afcesic-calibrate in sequence.

Functions

build_terra_json(bas_path, a_bas_path, out_path)

Parse TERRA binary files and write terra.json.

calibrate_afcesic(raw_dir, nasa9_path, ...)

Calibrate AFCESIC RF/CH constants to NASA and TERRA references.

dump_afcesic_raw(raw_dir, out_path)

Write a human-readable transcription of all raw AFCESIC binary records.

main()

Run the CLI entrypoint.

prometheus_equilibrium.tools.build_legacy_thermo.build_terra_json(bas_path: Path, a_bas_path: Path, out_path: Path) None

Parse TERRA binary files and write terra.json.

Parameters:
  • bas_path – Path to terra.bas.

  • a_bas_path – Path to terra_a.bas.

  • out_path – Output JSON path.

prometheus_equilibrium.tools.build_legacy_thermo.calibrate_afcesic(raw_dir: Path, nasa9_path: Path, nasa7_path: Path, terra_bas_path: Path, terra_a_bas_path: Path, out_path: Path, t_ref: float = 1000.0) None

Calibrate AFCESIC RF/CH constants to NASA and TERRA references.

Uses a hybrid strategy:
  1. If species exists in NASA-9/7, point-match both H and S at t_ref.

  2. Otherwise, apply a TERRA stoichiometric enthalpy shift using the dynamically discovered element references from TERRA.

Parameters:
  • raw_dir – Directory containing THERGG/THERII/THERSS DAT files.

  • nasa9_path – Path to NASA-9 JSON.

  • nasa7_path – Path to NASA-7 JSON.

  • terra_bas_path – Path to TERRA metadata binary.

  • terra_a_bas_path – Path to TERRA coefficient binary.

  • out_path – Output path for corrected AFCESIC JSON.

  • t_ref – Match temperature in K for NASA-overlap species.

Raises:

RuntimeError – If any AFCESIC species cannot be calibrated because both NASA overlap and TERRA stoichiometric references are unavailable.

prometheus_equilibrium.tools.build_legacy_thermo.main() None

Run the CLI entrypoint.