Convert
Format conversion utilities for base flow data.
Functions
convert_meanflow
Convert an HDF5 base flow to the Fortran binary format used by the LST solver.
lst_tools.convert.convert_meanflow
convert_meanflow(grid: Grid, flow: Flow, out: str | Path, *, cfg: Config, format: str = 'binary', debug_path: Path | str | None = None) -> Path
Convert grid and flow fields to LASTRAC meanflow format.
Steps performed
- Compute curvilinear coordinate s
- Compute surface angle and (optionally) rotate velocity profiles
- Compute local body radius and curvature
- Write meanflow file (Fortran binary or ASCII)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grid
|
Grid
|
Computational grid (lst_tools.core). |
required |
flow
|
Flow
|
Flow field data defined on grid (lst_tools.core). |
required |
out
|
str | Path
|
Output file path for the LASTRAC meanflow file. |
required |
cfg
|
dict
|
Configuration object (typically |
required |
format
|
str
|
Output format: |
'binary'
|
debug_path
|
Path | str | None
|
If given, write diagnostic files to this directory. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
The resolved output file path. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the configuration contains invalid station ranges or missing geometry type. |
generate_lst_input_deck
Generate an input deck for the LST solver.
lst_tools.convert.generate_lst_input_deck
Write a complete LASTRAC input deck to out_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
Config | None
|
Configuration object. |
None
|
out_path
|
str | Path
|
Destination file path for the input deck. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
The path the input deck was written to. |
convert_meanflow(grid, flow, "meanflow.bin", cfg=config)
This pattern is usually the main reason to switch from CLI to API.
Where the API Reference Fits
Use this page for practical workflow patterns. Use the API Reference when you need exact signatures, class definitions, module organization, or lower-level utility details.