Example scripts and workflows¶
The example scripts give you full control over plotting: figure layout,
colormaps, contour levels, overlays, and output format. The CLI command
bldfm run config.yaml --plot generates quick default plots (concentration +
flux/footprint with tower markers) for rapid inspection; use these scripts when
you need publication-quality figures or custom workflows.
BLDFM ships with instructional examples organised in three tiers of
increasing complexity. All plot output is saved to plots/ in the
repository root (create with mkdir -p plots if needed).
Config-driven examples (examples/)¶
Recommended starting point. These scripts use the high-level
YAML/dataclass workflow: load_config(), run_bldfm_single(), and the
plotting library. Each script has a matching YAML file in
examples/configs/.
Script |
Description |
|---|---|
|
Neutral BL concentration and flux fields |
|
3D output with vertical slices |
|
Point-source plume with horizontal and vertical slices (concentration and flux) |
|
Flux footprint with percentile contours |
|
Single-tower timeseries: footprint climatology workflow |
|
High-resolution solve with multi-threaded FFT |
|
Multiple towers over a synthetic timeseries |
|
Map tiles, land cover, wind rose, and interactive plots (optional deps) |
$ python examples/minimal_example.py
$ python examples/footprint_example.py
$ python examples/timeseries_example.py
Low-level API examples (examples/low_level/)¶
These scripts call vertical_profiles(), steady_state_transport_solver(),
and other solver-level functions directly. Use these to understand the
internals or to build custom workflows outside the config system.
Script |
Description |
|---|---|
|
Basic neutral BL solve |
|
3D output |
|
Point-source plume |
|
Flux footprint calculation |
|
Parallel execution |
|
Vertical profiles of wind and eddy diffusivity under MOST |
|
Point measurement via footprint convolution |
$ python examples/low_level/minimal_example.py
$ python examples/low_level/footprint_example.py
Source-area analysis (runs/low_level/)¶
The runs/low_level/ directory contains the source-area example:
$ python runs/low_level/source_area_example.py
Manuscript figures (runs/manuscript/)¶
These scripts reproduce the figures in the BLDFM paper. They are provided in two forms:
``runs/manuscript/interface/`` — Config-driven interface with
dataclasses.replace()for parameter mutation and the plotting library for figure generation.``runs/manuscript/low_level/`` — Direct API calls matching the original manuscript code.
To regenerate all manuscript figures (both tiers):
$ python runs/manuscript/generate_all.py
# Or only one tier:
$ python runs/manuscript/generate_all.py --tier interface
$ python runs/manuscript/generate_all.py --tier low_level
Plot naming conventions¶
All scripts use filename prefixes to distinguish their output in plots/:
test_*— Test-generated plots (e.g.test_interface_multitower_structure.png)examples_*— Config-driven example plots (e.g.examples_timeseries_aggregated.png)examples_low_level_*— Low-level example plots (e.g.examples_low_level_most_profiles.png)manuscript_*— Manuscript interface plots (e.g.manuscript_comparison_analytic.png)manuscript_low_level_*— Manuscript low-level plots (e.g.manuscript_low_level_comparison_analytic.png)