# inkenbrandt/footprints architecture

> Architecture diagram of the GitHub repository inkenbrandt/footprints, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inkenbrandt/footprints
- Repository: https://github.com/inkenbrandt/footprints

## Overview

fluxfootprints is a Python package for micrometeorological flux-footprint analysis. Its main user workflow accepts eddy-covariance tower data, prepares model inputs, computes per-timestep footprints and a climatology, then supports period summaries and geospatial exports. Users can select among five model implementations behind a shared interface. Separate capabilities include OpenET masking, representativeness assessment, model comparison, animation, and forcing or surface-data retrieval. The graph follows documented capabilities and sampled imports; some unsampled subsystems are included from the README and source index, with links omitted where their runtime wiring is not shown.

Main entry points: [`src/fluxfootprints/ffp_daily_monthly_helper.py`](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_daily_monthly_helper.py) (Build climatology), [`src/fluxfootprints/base_footprint_model.py`](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/base_footprint_model.py) (Model interface), [`src/fluxfootprints/kormannmeixner_adapter.py`](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/kormannmeixner_adapter.py) (Kormann-Meixner adapter), [`src/fluxfootprints/wang_footprint_adapter.py`](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/wang_footprint_adapter.py) (Wang adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Climatology workflow"]
  node_climatology["Build climatology"]
  node_summaries["Period summaries"]
end

subgraph group_models["Footprint models"]
  node_base["Model interface"]
  node_ffp["Kljun FFP<br/>[improved_ffp.py]"]
  node_ffp_xr["FFP xarray<br/>[ffp_xr.py]"]
  node_km_adapter["Kormann-Meixner adapter"]
  node_km_core["Kormann-Meixner model<br/>[kormannmeixner.py]"]
  node_wang_adapter["Wang adapter"]
  node_wang_core["Wang model<br/>[wang_footprint.py]"]
  node_ls_adapter["Lagrangian adapter"]
  node_ls_core["Lagrangian model"]
  node_ep["EP footprint<br/>[ep_footprint.py]"]
end

subgraph group_geospatial["Geospatial outputs"]
  node_openet["OpenET masking<br/>[openet_masking.py]"]
  node_openet_diag["Raster diagnostics"]
  node_animation["Footprint animation"]
  node_plotting["Footprint plotting"]
end

subgraph group_analysis["Analysis tools"]
  node_comparison["Model comparison<br/>[compare.py]"]
  node_represent["Representativeness"]
  node_rep_data["Surface data retrieval"]
  node_rep_plot["Representativeness plots"]
  node_uncertainty["Bootstrap uncertainty"]
end

subgraph group_inputs["Data and schema"]
  node_schema["Canonical schema"]
  node_nldas["NLDAS retrieval"]
  node_fetch["Row data fetch"]
end

node_user(("Analyst"))

node_user -->|"provides tower data"| node_climatology
node_climatology -->|"runs selected model"| node_ffp
node_climatology -->|"runs selected model"| node_ffp_xr
node_climatology -->|"runs selected model"| node_km_adapter
node_climatology -->|"runs selected model"| node_wang_adapter
node_climatology -->|"runs selected model"| node_ls_adapter
node_ffp -->|"implements interface"| node_base
node_ffp_xr -->|"implements interface"| node_base
node_km_adapter -->|"implements interface"| node_base
node_km_adapter -->|"adapts model"| node_km_core
node_wang_adapter -->|"implements interface"| node_base
node_wang_adapter -->|"adapts model"| node_wang_core
node_ls_adapter -->|"implements interface"| node_base
node_ls_adapter -->|"adapts model"| node_ls_core
node_user -->|"requests summaries"| node_summaries
node_user -->|"requests masking"| node_openet
node_user -->|"requests assessment"| node_represent
node_user -->|"requests comparison"| node_comparison
node_user -->|"requests animation"| node_animation
node_represent -->|"uses retrieved fields"| node_rep_data
node_represent -->|"plots diagnostics"| node_rep_plot
node_openet_diag -->|"diagnoses rasters"| node_openet
node_animation -->|"accepts period summaries"| node_summaries

click node_climatology "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_daily_monthly_helper.py"
click node_summaries "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_daily_monthly_helper.py"
click node_base "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/base_footprint_model.py"
click node_ffp "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/improved_ffp.py"
click node_ffp_xr "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_xr.py"
click node_km_adapter "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/kormannmeixner_adapter.py"
click node_km_core "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/kormannmeixner.py"
click node_wang_adapter "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/wang_footprint_adapter.py"
click node_wang_core "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/wang_footprint.py"
click node_ls_adapter "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ls_footprint_adapter.py"
click node_ls_core "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ls_footprint_model.py"
click node_schema "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/canonical_schema.py"
click node_comparison "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/compare.py"
click node_represent "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness.py"
click node_rep_data "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness_data.py"
click node_rep_plot "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness_plotting.py"
click node_openet "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/openet_masking.py"
click node_openet_diag "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/openet_raster_diagnostics.py"
click node_animation "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/footprint_animation.py"
click node_nldas "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/nldas_read_functions.py"
click node_fetch "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/by_row_fetch_tools.py"
click node_uncertainty "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/bootstrap_footprint_uncertainty.py"
click node_ep "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ep_footprint.py"
click node_plotting "https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/footprint_plotting.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_climatology,node_summaries toneBlue
class node_base,node_ffp,node_ffp_xr,node_km_adapter,node_km_core,node_wang_adapter,node_wang_core,node_ls_adapter,node_ls_core,node_ep toneAmber
class node_openet,node_openet_diag,node_animation,node_plotting toneMint
class node_comparison,node_represent,node_rep_data,node_rep_plot,node_uncertainty toneRose
class node_schema,node_nldas,node_fetch,node_user toneIndigo
```

## Components

### Climatology workflow

- [Build climatology](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_daily_monthly_helper.py): `src/fluxfootprints/ffp_daily_monthly_helper.py`
- [Period summaries](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_daily_monthly_helper.py): `src/fluxfootprints/ffp_daily_monthly_helper.py`

### Footprint models

- [Model interface](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/base_footprint_model.py): `src/fluxfootprints/base_footprint_model.py`
- [Kljun FFP](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/improved_ffp.py): `src/fluxfootprints/improved_ffp.py`
- [FFP xarray](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ffp_xr.py): `src/fluxfootprints/ffp_xr.py`
- [Kormann-Meixner adapter](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/kormannmeixner_adapter.py): `src/fluxfootprints/kormannmeixner_adapter.py`
- [Kormann-Meixner model](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/kormannmeixner.py): `src/fluxfootprints/kormannmeixner.py`
- [Wang adapter](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/wang_footprint_adapter.py): `src/fluxfootprints/wang_footprint_adapter.py`
- [Wang model](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/wang_footprint.py): `src/fluxfootprints/wang_footprint.py`
- [Lagrangian adapter](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ls_footprint_adapter.py): `src/fluxfootprints/ls_footprint_adapter.py`
- [Lagrangian model](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ls_footprint_model.py): `src/fluxfootprints/ls_footprint_model.py`
- [EP footprint](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/ep_footprint.py): `src/fluxfootprints/ep_footprint.py`

### Geospatial outputs

- [OpenET masking](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/openet_masking.py): `src/fluxfootprints/openet_masking.py`
- [Raster diagnostics](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/openet_raster_diagnostics.py): `src/fluxfootprints/openet_raster_diagnostics.py`
- [Footprint animation](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/footprint_animation.py): `src/fluxfootprints/footprint_animation.py`
- [Footprint plotting](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/footprint_plotting.py): `src/fluxfootprints/footprint_plotting.py`

### Analysis tools

- [Model comparison](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/compare.py): `src/fluxfootprints/compare.py`
- [Representativeness](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness.py): `src/fluxfootprints/representativeness.py`
- [Surface data retrieval](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness_data.py): `src/fluxfootprints/representativeness_data.py`
- [Representativeness plots](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/representativeness_plotting.py): `src/fluxfootprints/representativeness_plotting.py`
- [Bootstrap uncertainty](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/bootstrap_footprint_uncertainty.py): `src/fluxfootprints/bootstrap_footprint_uncertainty.py`

### Data and schema

- [Canonical schema](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/canonical_schema.py): `src/fluxfootprints/canonical_schema.py`
- [NLDAS retrieval](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/nldas_read_functions.py): `src/fluxfootprints/nldas_read_functions.py`
- [Row data fetch](https://github.com/inkenbrandt/footprints/blob/master/src/fluxfootprints/by_row_fetch_tools.py): `src/fluxfootprints/by_row_fetch_tools.py`

### Other components

- **Analyst**

## Connections

- Analyst → Build climatology: provides tower data (evidence: `README.md`)
- Build climatology → Kljun FFP: runs selected model (evidence: `README.md`)
- Build climatology → FFP xarray: runs selected model (evidence: `README.md`)
- Build climatology → Kormann-Meixner adapter: runs selected model (evidence: `README.md`)
- Build climatology → Wang adapter: runs selected model (evidence: `README.md`)
- Build climatology → Lagrangian adapter: runs selected model (evidence: `README.md`)
- Kljun FFP → Model interface: implements interface (evidence: `README.md`)
- FFP xarray → Model interface: implements interface (evidence: `README.md`)
- Kormann-Meixner adapter → Model interface: implements interface (evidence: `README.md`)
- Kormann-Meixner adapter → Kormann-Meixner model: adapts model (evidence: `src/fluxfootprints/kormannmeixner_adapter.py`)
- Wang adapter → Model interface: implements interface (evidence: `README.md`)
- Wang adapter → Wang model: adapts model (evidence: `src/fluxfootprints/wang_footprint_adapter.py`)
- Lagrangian adapter → Model interface: implements interface (evidence: `README.md`)
- Lagrangian adapter → Lagrangian model: adapts model (evidence: `src/fluxfootprints/ls_footprint_adapter.py`)
- Analyst → Period summaries: requests summaries (evidence: `README.md`)
- Analyst → OpenET masking: requests masking (evidence: `README.md`)
- Analyst → Representativeness: requests assessment (evidence: `README.md`)
- Analyst → Model comparison: requests comparison (evidence: `README.md`)
- Analyst → Footprint animation: requests animation (evidence: `README.md`)
- Representativeness → Surface data retrieval: uses retrieved fields (evidence: `src/fluxfootprints/representativeness_data.py`)
- Representativeness → Representativeness plots: plots diagnostics (evidence: `src/fluxfootprints/representativeness_plotting.py`)
- Raster diagnostics → OpenET masking: diagnoses rasters (evidence: `src/fluxfootprints/openet_raster_diagnostics.py`)
- Footprint animation → Period summaries: accepts period summaries (evidence: `src/fluxfootprints/footprint_animation.py`)
