aero_filewrite#

Pivots a list[StResult] into an AeroDatabase containing numpy arrays shaped for stability and control derivative lookup tables.

Convert list[StResult] into structured aero lookup tables.

class avl_aero_tables.aero_filewrite.AeroDatabase(date, Sref=0.0, Cref=0.0, Bref=0.0, Xref=0.0, Yref=0.0, Zref=0.0, stab=<factory>, ctrl=<factory>)[source]#

Bases: object

Aero coefficient tables built from a sweep of AVL .st results.

stab[coef] → StabTable for neutral-control cases ctrl[coef_surface] → CtrlTable for control-deflection cases

Parameters:
  • date (str)

  • Sref (float)

  • Cref (float)

  • Bref (float)

  • Xref (float)

  • Yref (float)

  • Zref (float)

  • stab (dict[str, StabTable])

  • ctrl (dict[str, CtrlTable])

Bref: float = 0.0#
Cref: float = 0.0#
Sref: float = 0.0#
Xref: float = 0.0#
Yref: float = 0.0#
Zref: float = 0.0#
ctrl: dict[str, CtrlTable]#
date: str#
stab: dict[str, StabTable]#
class avl_aero_tables.aero_filewrite.CtrlTable(coef, surface, ctrl_name, alpha, beta, defl, data)[source]#

Bases: object

3-D coefficient lookup table indexed by (alpha, beta, deflection).

Parameters:
  • coef (str)

  • surface (str)

  • ctrl_name (str)

  • alpha (ndarray)

  • beta (ndarray)

  • defl (ndarray)

  • data (ndarray)

alpha: ndarray#
beta: ndarray#
coef: str#
ctrl_name: str#
data: ndarray#
defl: ndarray#
surface: str#
class avl_aero_tables.aero_filewrite.StabTable(coef, alpha, beta, data)[source]#

Bases: object

2-D coefficient lookup table indexed by (alpha, beta).

Populated only for runs where all control surfaces are at neutral (0 deg).

Parameters:
  • coef (str)

  • alpha (ndarray)

  • beta (ndarray)

  • data (ndarray)

alpha: ndarray#
beta: ndarray#
coef: str#
data: ndarray#
avl_aero_tables.aero_filewrite.aero_filewrite(results)[source]#

Pivot list[StResult] into an AeroDatabase of (alpha × beta [× defl]) tables.

Stability tables are populated only for neutral-control runs (all deflections zero). Control tables are populated for all runs regardless of deflection.

Parameters:

results (list[StResult]) – Output from avl_sweep.run() or st_fileread().

Returns:

Structured lookup tables keyed by coefficient name (and surface name for control tables).

Return type:

AeroDatabase

Example

>>> from avl_aero_tables import avl_sweep
>>> from avl_aero_tables.aero_filewrite import aero_filewrite
>>> results = avl_sweep("examples/bd.avl", alpha=[-5, 0, 5, 10], beta=[0])
AVL sweep complete → ...  (4 cases)
>>> db = aero_filewrite(results)
>>> db.stab["CLtot"].data.shape
(4, 1)
>>> list(db.stab)
['CLtot', 'CYtot', 'CDtot', 'Cltot', 'Cmtot', 'Cntot']
avl_aero_tables.aero_filewrite.results_to_dataframe(results)[source]#

Convert a list of StResult to a pandas DataFrame (one row per case).

Each row contains the filename plus every key from StResult.data (Alpha, Beta, CLtot, control deflections, stability derivatives, etc.). This is the recommended format for saving results to CSV, HDF5, Parquet, or any other tabular format.

Example

>>> from avl_aero_tables import avl_sweep
>>> from avl_aero_tables.aero_filewrite import results_to_dataframe
>>> results = avl_sweep("examples/bd.avl", alpha=[0, 5], beta=[0])
AVL sweep complete → ...
>>> df = results_to_dataframe(results)
>>> "Alpha" in df.columns and "CLtot" in df.columns
True
>>> df.to_csv("sweep.csv", index=False)
Parameters:

results (list[StResult])

Return type:

pd.DataFrame