Skip to main content

A comprehensive Python package for micrometeorological footprint analysis

Project description

Flux-footprints

FluxFootprint is a fast, fully‑featured Python implementation of the Kljun et al. (2015) flux‑footprint parameterisation for eddy‑covariance research. It provides vectorised and xarray‑enabled utilities to compute per‑timestamp footprints, aggregate footprint climatologies, extract source‑area contours, and visualise results—scaling seamlessly from single towers to multi‑year datasets.


Table of Contents

  1. Key Features
  2. Installation
  3. Quick‑start Example
  4. Command‑line Interface
  5. Documentation
  6. Input Requirements
  7. Citing & Referencing
  8. Contributing
  9. Development Road‑map
  10. License

Key Features

Category Highlights
Core model • Implements Eq. 14 & 17 of Kljun et al. (2015) with stability‑specific coefficients
• Optional roughness‑sublayer corrections
• Supports per‑footprint filtering based on theoretical validity limits
Performance • Pure NumPy + xarray for vectorised calculations
• Lazy computation and Dask compatibility for large archives
I/O & preprocessing • Pandas helpers to map tower log fields automatically
• Quality‑control filters for u* ≥ 0.1 m s⁻¹, finite σᵥ, etc.
Analysis tools • Aggregate footprint climatologies
• Compute r% source‑area contours (10–90 %)
• Functions to derive transects, footprint peak statistics, and 80 % area coverage
Visualisation • Matplotlib helpers for heat‑maps & contour overlays
• Geospatial export to GeoTIFF / shapefile (EPSG aware)
Extensibility • Modular class design (FFPModel, FFPClimatology)
• Plug‑in hooks for alternative parameter sets or dispersion schemes
Reproducibility • 100 % test coverage with pytest
• Pre‑commit hooks (black, ruff, isort, doc8)

Installation

# Stable release (PyPI)
pip install fluxfootprint

# Development version (GitHub)
pip install git+https://github.com/YourOrg/fluxfootprint.git

Minimum Python 3.9. Core dependencies: numpy, pandas, xarray, scipy, matplotlib. Optional: dask, rioxarray, pyproj for advanced geospatial export.


Quick‑start Example

import pandas as pd
from fluxfootprint import FFPModel

# 1. Load half‑hourly tower data ----------------------------
df = pd.read_csv("AMF_US-CRT_BASE_HH_3-5_abb.csv", parse_dates=["TIMESTAMP"])

# Minimal renaming if your columns differ
df = df.rename(
    columns={
        "V_SIGMA": "V_SIGMA",
        "USTAR": "USTAR",
        "MO_LENGTH": "MO_LENGTH",
        "WD": "WD",
        "WS": "WS",
    }
)

# 2. Instantiate the model ----------------------------------
model = FFPModel(
    df,
    domain=[-1_000, 1_000, -1_000, 1_000],
    dx=2,
    dy=2,
    inst_height=3.5,
    crop_height=0.2,
    smooth_data=True,
)

# 3. Run & retrieve results ---------------------------------
result = model.run()            # dict with x_2d, y_2d, fclim_2d …

# 4. Plot 80 % source area ----------------------------------
model.plot_contour(r=0.8)

Command‑line Interface

# Compute footprint climatology for a CSV file
fluxfootprint run \
  --input  met_data.csv \
  --dz     3.5 \
  --domain -1000 1000 -1000 1000 \
  --dx     2 \
  --out    footprint.nc

Run fluxfootprint --help for all options.


Documentation

Full API docs, tutorials, and example notebooks are hosted at Read the Docs:

https://fluxfootprint.readthedocs.io

To build locally:

pip install -r docs/requirements.txt
sphinx-build -M html docs/ docs/_build

Input Requirements

Column Units Description
USTAR m s⁻¹ Friction velocity, u*
V_SIGMA m s⁻¹ Lateral velocity std. dev., σᵥ
MO_LENGTH m Monin–Obukhov length, L
WD ° Wind direction (0–360)
WS m s⁻¹ Mean wind speed at zₘ
(optional) crop_height m Canopy height, h_c
(optional) atm_bound_height m Boundary‑layer height, h

Any additional columns are ignored unless you plug in custom routines.


Citing & Referencing

If you use Flux-Footprints in a publication, please cite the original parameterisation:

Kljun, N., Calanca, P., Rotach, M.W., & Schmid, H.P. (2015). A simple two‑dimensional parameterisation for flux footprint prediction (FFP). Geoscientific Model Development, 8(11), 3695–3713. https://doi.org/10.5194/gmd-8-3695-2015

You may also cite the software directly (see CITATION.cff).


Contributing

  1. Fork → 2. Create branch → 3. Commit changes
  2. Run tests (pytest) & linters (pre‑commit run --all-files)
  3. Open a pull‑request

All contributions—bug reports, suggestions, or code—are welcome!


Development Road‑map

  • Footprint uncertainty quantification via Monte‑Carlo resampling
  • GPU acceleration using CuPy
  • Footprint aggregation across different time periods
  • QGIS plug‑in for in‑map footprint visualisation

License

This project is licensed under the MIT License – see the LICENSE file for details.


Happy footprinting!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluxfootprints-0.1.9.tar.gz (16.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fluxfootprints-0.1.9-py3-none-any.whl (95.3 kB view details)

Uploaded Python 3

File details

Details for the file fluxfootprints-0.1.9.tar.gz.

File metadata

  • Download URL: fluxfootprints-0.1.9.tar.gz
  • Upload date:
  • Size: 16.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for fluxfootprints-0.1.9.tar.gz
Algorithm Hash digest
SHA256 674bf8f60e4c55adb02a47c872fe54816855ec95e9a14c64c52c208dafe8315e
MD5 c9f468201167ed8b485a173bfc1ba788
BLAKE2b-256 7eb65c2730ae8cbc34e3496ff9f411e9d828d884264827828818ee6945a09968

See more details on using hashes here.

File details

Details for the file fluxfootprints-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: fluxfootprints-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 95.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for fluxfootprints-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 59ba5f30674215f92d5912a466fc30fd54bc9308f1ce5261ffa6bf66ccdb5463
MD5 be6b77da610f8d390a1efbec1f8ef28a
BLAKE2b-256 c2f9e9d468572f41c8589e93e6a0b2f6df03d0eec9b3afc2105d6103afcba93d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page