fluxfootprints 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fluxfootprints-0.1.0/.gitignore +15 -0
- fluxfootprints-0.1.0/.idea/.gitignore +8 -0
- fluxfootprints-0.1.0/.idea/footprints.iml +8 -0
- fluxfootprints-0.1.0/.idea/inspectionProfiles/Project_Default.xml +19 -0
- fluxfootprints-0.1.0/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- fluxfootprints-0.1.0/.idea/misc.xml +9 -0
- fluxfootprints-0.1.0/.idea/modules.xml +8 -0
- fluxfootprints-0.1.0/.idea/vcs.xml +6 -0
- fluxfootprints-0.1.0/.readthedocs.yaml +23 -0
- fluxfootprints-0.1.0/.vscode/launch.json +15 -0
- fluxfootprints-0.1.0/CITATION.cff +19 -0
- fluxfootprints-0.1.0/LICENSE +21 -0
- fluxfootprints-0.1.0/PKG-INFO +230 -0
- fluxfootprints-0.1.0/README.md +187 -0
- fluxfootprints-0.1.0/__pycache__/ffp_module.cpython-312.pyc +0 -0
- fluxfootprints-0.1.0/data/2011-01-01_US-CRT.tif +0 -0
- fluxfootprints-0.1.0/data/AMF_US-CRT_BASE_HH_3-5.csv +52611 -0
- fluxfootprints-0.1.0/data/AMF_US-CRT_BASE_HH_3-5_abb.csv +30 -0
- fluxfootprints-0.1.0/data/TOB1_23861_Flux_CSFormat_32.dat +0 -0
- fluxfootprints-0.1.0/data/US-CRT_config.ini +81 -0
- fluxfootprints-0.1.0/data/reformatter_vars.yml +602 -0
- fluxfootprints-0.1.0/data/station_config/AmeriFlux-site-search-results-202409031049.tsv +10 -0
- fluxfootprints-0.1.0/data/station_config/AmeriFlux-sites.csv +10 -0
- fluxfootprints-0.1.0/data/station_config/US-UTE.ini +69 -0
- fluxfootprints-0.1.0/data/station_config/US-UTW.ini +69 -0
- fluxfootprints-0.1.0/data/station_config/datafile.metadata +413 -0
- fluxfootprints-0.1.0/data/station_config/gridMET_data/US-UTE_37.7333N_-111.5583W.csv +408 -0
- fluxfootprints-0.1.0/data/station_config/gridMET_data/US-UTW_39.4417N_-110.7250W.csv +1303 -0
- fluxfootprints-0.1.0/data/station_config/stations.geojson +15 -0
- fluxfootprints-0.1.0/data/station_config/template_config.ini +65 -0
- fluxfootprints-0.1.0/docs/Makefile +20 -0
- fluxfootprints-0.1.0/docs/conf.py +50 -0
- fluxfootprints-0.1.0/docs/fluxfootprints.rst +69 -0
- fluxfootprints-0.1.0/docs/index.rst +19 -0
- fluxfootprints-0.1.0/docs/make.bat +35 -0
- fluxfootprints-0.1.0/docs/modules.rst +7 -0
- fluxfootprints-0.1.0/docs/notebooks/AMF_Daily.ipynb +212 -0
- fluxfootprints-0.1.0/docs/notebooks/LANDSAT GRIDS.ipynb +617 -0
- fluxfootprints-0.1.0/docs/notebooks/NLDAS_Download_and_Summarize.ipynb +650 -0
- fluxfootprints-0.1.0/docs/notebooks/US-UTE.ini +69 -0
- fluxfootprints-0.1.0/docs/notebooks/US-UTE_37.7333N_-111.5583W.csv +408 -0
- fluxfootprints-0.1.0/docs/notebooks/US-UTE_HH_202406241430_202409251400.csv +4464 -0
- fluxfootprints-0.1.0/docs/notebooks/download_big_rasters.ipynb +174 -0
- fluxfootprints-0.1.0/docs/notebooks/footprint.ipynb +9126 -0
- fluxfootprints-0.1.0/docs/notebooks/m_to_py_notebook.ipynb +132 -0
- fluxfootprints-0.1.0/docs/notebooks/multiply_rasters.ipynb +298 -0
- fluxfootprints-0.1.0/docs/notebooks/row_footprint.ipynb +1191 -0
- fluxfootprints-0.1.0/docs/notebooks/test.ipynb +452 -0
- fluxfootprints-0.1.0/docs/notebooks/wang2006_demo.ipynb +172 -0
- fluxfootprints-0.1.0/docs/requirements.txt +26 -0
- fluxfootprints-0.1.0/pyproject.toml +59 -0
- fluxfootprints-0.1.0/setup.cfg +4 -0
- fluxfootprints-0.1.0/src/fluxfootprints/__init__.py +49 -0
- fluxfootprints-0.1.0/src/fluxfootprints/compare.py +553 -0
- fluxfootprints-0.1.0/src/fluxfootprints/ep_footprint.py +555 -0
- fluxfootprints-0.1.0/src/fluxfootprints/ffp_xr.py +516 -0
- fluxfootprints-0.1.0/src/fluxfootprints/footprint_plotting.py +365 -0
- fluxfootprints-0.1.0/src/fluxfootprints/improved_ffp.py +1865 -0
- fluxfootprints-0.1.0/src/fluxfootprints/kljun_code.py +1013 -0
- fluxfootprints-0.1.0/src/fluxfootprints/kormannmeixner.py +455 -0
- fluxfootprints-0.1.0/src/fluxfootprints/ls_footprint_model.py +296 -0
- fluxfootprints-0.1.0/src/fluxfootprints/new_ffp.py +540 -0
- fluxfootprints-0.1.0/src/fluxfootprints/tools.py +216 -0
- fluxfootprints-0.1.0/src/fluxfootprints/volk.py +2172 -0
- fluxfootprints-0.1.0/src/fluxfootprints/wang_footprint.py +214 -0
- fluxfootprints-0.1.0/src/fluxfootprints.egg-info/PKG-INFO +230 -0
- fluxfootprints-0.1.0/src/fluxfootprints.egg-info/SOURCES.txt +83 -0
- fluxfootprints-0.1.0/src/fluxfootprints.egg-info/dependency_links.txt +1 -0
- fluxfootprints-0.1.0/src/fluxfootprints.egg-info/requires.txt +32 -0
- fluxfootprints-0.1.0/src/fluxfootprints.egg-info/top_level.txt +1 -0
- fluxfootprints-0.1.0/tests/__init__.py +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/__init__.cpython-313.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_compare.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_ep_footprint.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_ffp_xr.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_improved_ffp.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_tools.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/__pycache__/test_volk.cpython-313-pytest-8.3.5.pyc +0 -0
- fluxfootprints-0.1.0/tests/test_compare.py +164 -0
- fluxfootprints-0.1.0/tests/test_ep_footprint.py +216 -0
- fluxfootprints-0.1.0/tests/test_ffp_xr.py +127 -0
- fluxfootprints-0.1.0/tests/test_improved_ffp.py +172 -0
- fluxfootprints-0.1.0/tests/test_new_ffp.py +92 -0
- fluxfootprints-0.1.0/tests/test_tools.py +107 -0
- fluxfootprints-0.1.0/tests/test_volk.py +83 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/.pytest_cache
|
|
2
|
+
/.idea
|
|
3
|
+
/__pycache__
|
|
4
|
+
/.vscode
|
|
5
|
+
/src/fluxfootprints/__pycache__
|
|
6
|
+
/docs/_build
|
|
7
|
+
/docs/notebooks/output
|
|
8
|
+
/docs/notebooks/example.log
|
|
9
|
+
/secrets
|
|
10
|
+
/data/logs
|
|
11
|
+
/data/station_data
|
|
12
|
+
/data/station_config/output
|
|
13
|
+
/docs/notebooks/NLDAS_data
|
|
14
|
+
/docs/notebooks/2021_utah_merged.parquet
|
|
15
|
+
/docs/notebooks/2021_utah_merged.nc
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
5
|
+
<option name="ourVersions">
|
|
6
|
+
<value>
|
|
7
|
+
<list size="6">
|
|
8
|
+
<item index="0" class="java.lang.String" itemvalue="3.13" />
|
|
9
|
+
<item index="1" class="java.lang.String" itemvalue="3.8" />
|
|
10
|
+
<item index="2" class="java.lang.String" itemvalue="3.9" />
|
|
11
|
+
<item index="3" class="java.lang.String" itemvalue="3.10" />
|
|
12
|
+
<item index="4" class="java.lang.String" itemvalue="3.11" />
|
|
13
|
+
<item index="5" class="java.lang.String" itemvalue="3.12" />
|
|
14
|
+
</list>
|
|
15
|
+
</value>
|
|
16
|
+
</option>
|
|
17
|
+
</inspection_tool>
|
|
18
|
+
</profile>
|
|
19
|
+
</component>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="Black">
|
|
4
|
+
<option name="enabledOnReformat" value="true" />
|
|
5
|
+
<option name="enabledOnSave" value="true" />
|
|
6
|
+
<option name="sdkName" value="pygis12" />
|
|
7
|
+
</component>
|
|
8
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
|
|
9
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/footprints.iml" filepath="$PROJECT_DIR$/.idea/footprints.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
# Set the OS, Python version, and other tools you might need
|
|
8
|
+
build:
|
|
9
|
+
os: ubuntu-24.04
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.12"
|
|
12
|
+
|
|
13
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
14
|
+
sphinx:
|
|
15
|
+
configuration: docs/conf.py
|
|
16
|
+
|
|
17
|
+
# Optionally, but recommended,
|
|
18
|
+
# declare the Python requirements required to build your documentation
|
|
19
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
20
|
+
python:
|
|
21
|
+
install:
|
|
22
|
+
- requirements: docs/requirements.txt
|
|
23
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Python Debugger: Current File",
|
|
9
|
+
"type": "debugpy",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"program": "${file}",
|
|
12
|
+
"console": "integratedTerminal"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
authors:
|
|
4
|
+
- family-names: "Kljun"
|
|
5
|
+
given-names: "Natascha"
|
|
6
|
+
orcid: "https://orcid.org/0000-0001-9650-2184"
|
|
7
|
+
- family-names: "Volk"
|
|
8
|
+
given-names: "John"
|
|
9
|
+
orcid: "https://orcid.org/0000-0001-9994-1545"
|
|
10
|
+
- family-names: "Inkenbrandt"
|
|
11
|
+
given-names: "Paul"
|
|
12
|
+
orcid: "https://orcid.org/0000-0002-9194-5936"
|
|
13
|
+
- family-names: "Schroeder"
|
|
14
|
+
given-names: "Martin"
|
|
15
|
+
title: "flux-footprints"
|
|
16
|
+
version: 0.1.0
|
|
17
|
+
doi: 10.5281/zenodo.1234
|
|
18
|
+
date-released: 2025-05-01
|
|
19
|
+
url: "https://github.com/inkenbrandt/footprints"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 inkenbrandt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fluxfootprints
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A comprehensive Python package for micrometeorological footprint analysis
|
|
5
|
+
Author-email: Paul Inkenbrandt <paulinkenbrandt@utah.gov>, Kathryn Ladig <kladig@utah.gov>, Natascha Kljun <natascha.kljun@cec.lu.se>, John Volk <John.Volk@dri.edu>
|
|
6
|
+
License: GNU General Public License v3.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/inkenbrandt/micromet
|
|
8
|
+
Project-URL: Documentation, https://micromet.readthedocs.io/en/stable/
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: python>=3.10
|
|
13
|
+
Requires-Dist: numpy>=1.20
|
|
14
|
+
Requires-Dist: pandas>=1.3
|
|
15
|
+
Requires-Dist: scipy>=1.7
|
|
16
|
+
Requires-Dist: matplotlib>=3.4
|
|
17
|
+
Requires-Dist: plotly>=5.0
|
|
18
|
+
Requires-Dist: sqlalchemy>=1.4
|
|
19
|
+
Requires-Dist: pyyaml>=5.4
|
|
20
|
+
Requires-Dist: requests>=2.25
|
|
21
|
+
Requires-Dist: xarray>=0.18
|
|
22
|
+
Requires-Dist: netcdf4>=1.5
|
|
23
|
+
Requires-Dist: pyproj>=3.2
|
|
24
|
+
Requires-Dist: rasterio>=1.2
|
|
25
|
+
Requires-Dist: geopandas>=0.9
|
|
26
|
+
Requires-Dist: shapely>=1.7
|
|
27
|
+
Requires-Dist: affine>=2.3
|
|
28
|
+
Requires-Dist: cv2>=4.5
|
|
29
|
+
Requires-Dist: fluxdataqaqc>=0.1.0
|
|
30
|
+
Requires-Dist: refet>=0.1.0
|
|
31
|
+
Provides-Extra: docs
|
|
32
|
+
Requires-Dist: sphinx>=4.0; extra == "docs"
|
|
33
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
|
|
34
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
|
|
35
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.12; extra == "docs"
|
|
36
|
+
Requires-Dist: myst-parser>=0.15; extra == "docs"
|
|
37
|
+
Requires-Dist: numpydoc>=1.1; extra == "docs"
|
|
38
|
+
Requires-Dist: nbsphinx>=0.8; extra == "docs"
|
|
39
|
+
Provides-Extra: test
|
|
40
|
+
Requires-Dist: pytest>=6.0; extra == "test"
|
|
41
|
+
Requires-Dist: pytest-cov>=2.0; extra == "test"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# Flux-footprints
|
|
45
|
+
|
|
46
|
+
> **FluxFootprint** is a fast, fully‑featured Python implementation of the
|
|
47
|
+
> Kljun et al. (2015) flux‑footprint parameterisation for eddy‑covariance research.
|
|
48
|
+
> It provides vectorised and xarray‑enabled utilities to compute per‑timestamp
|
|
49
|
+
> footprints, aggregate footprint climatologies, extract source‑area contours,
|
|
50
|
+
> and visualise results—scaling seamlessly from single towers to multi‑year
|
|
51
|
+
> datasets.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Table of Contents
|
|
56
|
+
|
|
57
|
+
1. [Key Features](#key-features)
|
|
58
|
+
2. [Installation](#installation)
|
|
59
|
+
3. [Quick‑start Example](#quick-start-example)
|
|
60
|
+
4. [Command‑line Interface](#command-line-interface)
|
|
61
|
+
5. [Documentation](#documentation)
|
|
62
|
+
6. [Input Requirements](#input-requirements)
|
|
63
|
+
7. [Citing & Referencing](#citing--referencing)
|
|
64
|
+
8. [Contributing](#contributing)
|
|
65
|
+
9. [Development Road‑map](#development-road-map)
|
|
66
|
+
10. [License](#license)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### Key Features
|
|
71
|
+
|
|
72
|
+
| Category | Highlights |
|
|
73
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
74
|
+
| **Core model** | • Implements Eq. 14 & 17 of Kljun et al. (2015) with stability‑specific coefficients<br>• Optional roughness‑sublayer corrections<br>• Supports per‑footprint filtering based on theoretical validity limits |
|
|
75
|
+
| **Performance** | • Pure NumPy + xarray for vectorised calculations<br>• Lazy computation and Dask compatibility for large archives |
|
|
76
|
+
| **I/O & preprocessing** | • Pandas helpers to map tower log fields automatically<br>• Quality‑control filters for *u\* ≥ 0.1 m s⁻¹*, finite σᵥ, etc. |
|
|
77
|
+
| **Analysis tools** | • Aggregate footprint climatologies<br>• Compute *r%* source‑area contours (10–90 %)<br>• Functions to derive transects, footprint peak statistics, and 80 % area coverage |
|
|
78
|
+
| **Visualisation** | • Matplotlib helpers for heat‑maps & contour overlays<br>• Geospatial export to GeoTIFF / shapefile (EPSG aware) |
|
|
79
|
+
| **Extensibility** | • Modular class design (`FFPModel`, `FFPClimatology`)<br>• Plug‑in hooks for alternative parameter sets or dispersion schemes |
|
|
80
|
+
| **Reproducibility** | • 100 % test coverage with `pytest`<br>• Pre‑commit hooks (black, ruff, isort, doc8) |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Stable release (PyPI)
|
|
88
|
+
pip install fluxfootprint
|
|
89
|
+
|
|
90
|
+
# Development version (GitHub)
|
|
91
|
+
pip install git+https://github.com/YourOrg/fluxfootprint.git
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
> Minimum Python 3.9. Core dependencies: `numpy`, `pandas`, `xarray`,
|
|
95
|
+
> `scipy`, `matplotlib`. Optional: `dask`, `rioxarray`, `pyproj` for advanced
|
|
96
|
+
> geospatial export.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Quick‑start Example
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import pandas as pd
|
|
104
|
+
from fluxfootprint import FFPModel
|
|
105
|
+
|
|
106
|
+
# 1. Load half‑hourly tower data ----------------------------
|
|
107
|
+
df = pd.read_csv("AMF_US-CRT_BASE_HH_3-5_abb.csv", parse_dates=["TIMESTAMP"])
|
|
108
|
+
|
|
109
|
+
# Minimal renaming if your columns differ
|
|
110
|
+
df = df.rename(
|
|
111
|
+
columns={
|
|
112
|
+
"V_SIGMA": "V_SIGMA",
|
|
113
|
+
"USTAR": "USTAR",
|
|
114
|
+
"MO_LENGTH": "MO_LENGTH",
|
|
115
|
+
"WD": "WD",
|
|
116
|
+
"WS": "WS",
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
# 2. Instantiate the model ----------------------------------
|
|
121
|
+
model = FFPModel(
|
|
122
|
+
df,
|
|
123
|
+
domain=[-1_000, 1_000, -1_000, 1_000],
|
|
124
|
+
dx=2,
|
|
125
|
+
dy=2,
|
|
126
|
+
inst_height=3.5,
|
|
127
|
+
crop_height=0.2,
|
|
128
|
+
smooth_data=True,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# 3. Run & retrieve results ---------------------------------
|
|
132
|
+
result = model.run() # dict with x_2d, y_2d, fclim_2d …
|
|
133
|
+
|
|
134
|
+
# 4. Plot 80 % source area ----------------------------------
|
|
135
|
+
model.plot_contour(r=0.8)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Command‑line Interface
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Compute footprint climatology for a CSV file
|
|
144
|
+
fluxfootprint run \
|
|
145
|
+
--input met_data.csv \
|
|
146
|
+
--dz 3.5 \
|
|
147
|
+
--domain -1000 1000 -1000 1000 \
|
|
148
|
+
--dx 2 \
|
|
149
|
+
--out footprint.nc
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Run `fluxfootprint --help` for all options.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### Documentation
|
|
157
|
+
|
|
158
|
+
Full API docs, tutorials, and example notebooks are hosted at **Read the Docs**:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
https://fluxfootprint.readthedocs.io
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
To build locally:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pip install -r docs/requirements.txt
|
|
168
|
+
sphinx-build -M html docs/ docs/_build
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### Input Requirements
|
|
174
|
+
|
|
175
|
+
| Column | Units | Description |
|
|
176
|
+
| ------------------------------- | ----- | ------------------------------ |
|
|
177
|
+
| `USTAR` | m s⁻¹ | Friction velocity, u\* |
|
|
178
|
+
| `V_SIGMA` | m s⁻¹ | Lateral velocity std. dev., σᵥ |
|
|
179
|
+
| `MO_LENGTH` | m | Monin–Obukhov length, L |
|
|
180
|
+
| `WD` | ° | Wind direction (0–360) |
|
|
181
|
+
| `WS` | m s⁻¹ | Mean wind speed at *zₘ* |
|
|
182
|
+
| *(optional)* `crop_height` | m | Canopy height, h\_c |
|
|
183
|
+
| *(optional)* `atm_bound_height` | m | Boundary‑layer height, h |
|
|
184
|
+
|
|
185
|
+
Any additional columns are ignored unless you plug in custom routines.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Citing & Referencing
|
|
190
|
+
|
|
191
|
+
If you use *Flux-Footprints* in a publication, please cite the original
|
|
192
|
+
parameterisation:
|
|
193
|
+
|
|
194
|
+
> Kljun, N., Calanca, P., Rotach, M.W., & Schmid, H.P. (2015).
|
|
195
|
+
> **A simple two‑dimensional parameterisation for flux footprint prediction (FFP)**.
|
|
196
|
+
> *Geoscientific Model Development*, 8(11), 3695–3713.
|
|
197
|
+
> [https://doi.org/10.5194/gmd-8-3695-2015](https://doi.org/10.5194/gmd-8-3695-2015)
|
|
198
|
+
|
|
199
|
+
You may also cite the software directly (see `CITATION.cff`).
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### Contributing
|
|
204
|
+
|
|
205
|
+
1. **Fork** → 2. **Create branch** → 3. **Commit changes**
|
|
206
|
+
2. **Run tests** (`pytest`) & linters (`pre‑commit run --all-files`)
|
|
207
|
+
3. **Open a pull‑request**
|
|
208
|
+
|
|
209
|
+
All contributions—bug reports, suggestions, or code—are welcome!
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
### Development Road‑map
|
|
214
|
+
|
|
215
|
+
* [ ] Footprint uncertainty quantification via Monte‑Carlo resampling
|
|
216
|
+
* [ ] GPU acceleration using CuPy
|
|
217
|
+
* [ ] Footprint aggregation across different time periods
|
|
218
|
+
* [ ] QGIS plug‑in for in‑map footprint visualisation
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### License
|
|
223
|
+
|
|
224
|
+
This project is licensed under the **MIT License** – see the
|
|
225
|
+
[`LICENSE`](LICENSE) file for details.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
*Happy footprinting!*
|
|
230
|
+
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Flux-footprints
|
|
2
|
+
|
|
3
|
+
> **FluxFootprint** is a fast, fully‑featured Python implementation of the
|
|
4
|
+
> Kljun et al. (2015) flux‑footprint parameterisation for eddy‑covariance research.
|
|
5
|
+
> It provides vectorised and xarray‑enabled utilities to compute per‑timestamp
|
|
6
|
+
> footprints, aggregate footprint climatologies, extract source‑area contours,
|
|
7
|
+
> and visualise results—scaling seamlessly from single towers to multi‑year
|
|
8
|
+
> datasets.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
### Table of Contents
|
|
13
|
+
|
|
14
|
+
1. [Key Features](#key-features)
|
|
15
|
+
2. [Installation](#installation)
|
|
16
|
+
3. [Quick‑start Example](#quick-start-example)
|
|
17
|
+
4. [Command‑line Interface](#command-line-interface)
|
|
18
|
+
5. [Documentation](#documentation)
|
|
19
|
+
6. [Input Requirements](#input-requirements)
|
|
20
|
+
7. [Citing & Referencing](#citing--referencing)
|
|
21
|
+
8. [Contributing](#contributing)
|
|
22
|
+
9. [Development Road‑map](#development-road-map)
|
|
23
|
+
10. [License](#license)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Key Features
|
|
28
|
+
|
|
29
|
+
| Category | Highlights |
|
|
30
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
31
|
+
| **Core model** | • Implements Eq. 14 & 17 of Kljun et al. (2015) with stability‑specific coefficients<br>• Optional roughness‑sublayer corrections<br>• Supports per‑footprint filtering based on theoretical validity limits |
|
|
32
|
+
| **Performance** | • Pure NumPy + xarray for vectorised calculations<br>• Lazy computation and Dask compatibility for large archives |
|
|
33
|
+
| **I/O & preprocessing** | • Pandas helpers to map tower log fields automatically<br>• Quality‑control filters for *u\* ≥ 0.1 m s⁻¹*, finite σᵥ, etc. |
|
|
34
|
+
| **Analysis tools** | • Aggregate footprint climatologies<br>• Compute *r%* source‑area contours (10–90 %)<br>• Functions to derive transects, footprint peak statistics, and 80 % area coverage |
|
|
35
|
+
| **Visualisation** | • Matplotlib helpers for heat‑maps & contour overlays<br>• Geospatial export to GeoTIFF / shapefile (EPSG aware) |
|
|
36
|
+
| **Extensibility** | • Modular class design (`FFPModel`, `FFPClimatology`)<br>• Plug‑in hooks for alternative parameter sets or dispersion schemes |
|
|
37
|
+
| **Reproducibility** | • 100 % test coverage with `pytest`<br>• Pre‑commit hooks (black, ruff, isort, doc8) |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Stable release (PyPI)
|
|
45
|
+
pip install fluxfootprint
|
|
46
|
+
|
|
47
|
+
# Development version (GitHub)
|
|
48
|
+
pip install git+https://github.com/YourOrg/fluxfootprint.git
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> Minimum Python 3.9. Core dependencies: `numpy`, `pandas`, `xarray`,
|
|
52
|
+
> `scipy`, `matplotlib`. Optional: `dask`, `rioxarray`, `pyproj` for advanced
|
|
53
|
+
> geospatial export.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### Quick‑start Example
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import pandas as pd
|
|
61
|
+
from fluxfootprint import FFPModel
|
|
62
|
+
|
|
63
|
+
# 1. Load half‑hourly tower data ----------------------------
|
|
64
|
+
df = pd.read_csv("AMF_US-CRT_BASE_HH_3-5_abb.csv", parse_dates=["TIMESTAMP"])
|
|
65
|
+
|
|
66
|
+
# Minimal renaming if your columns differ
|
|
67
|
+
df = df.rename(
|
|
68
|
+
columns={
|
|
69
|
+
"V_SIGMA": "V_SIGMA",
|
|
70
|
+
"USTAR": "USTAR",
|
|
71
|
+
"MO_LENGTH": "MO_LENGTH",
|
|
72
|
+
"WD": "WD",
|
|
73
|
+
"WS": "WS",
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# 2. Instantiate the model ----------------------------------
|
|
78
|
+
model = FFPModel(
|
|
79
|
+
df,
|
|
80
|
+
domain=[-1_000, 1_000, -1_000, 1_000],
|
|
81
|
+
dx=2,
|
|
82
|
+
dy=2,
|
|
83
|
+
inst_height=3.5,
|
|
84
|
+
crop_height=0.2,
|
|
85
|
+
smooth_data=True,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
# 3. Run & retrieve results ---------------------------------
|
|
89
|
+
result = model.run() # dict with x_2d, y_2d, fclim_2d …
|
|
90
|
+
|
|
91
|
+
# 4. Plot 80 % source area ----------------------------------
|
|
92
|
+
model.plot_contour(r=0.8)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### Command‑line Interface
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Compute footprint climatology for a CSV file
|
|
101
|
+
fluxfootprint run \
|
|
102
|
+
--input met_data.csv \
|
|
103
|
+
--dz 3.5 \
|
|
104
|
+
--domain -1000 1000 -1000 1000 \
|
|
105
|
+
--dx 2 \
|
|
106
|
+
--out footprint.nc
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Run `fluxfootprint --help` for all options.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Documentation
|
|
114
|
+
|
|
115
|
+
Full API docs, tutorials, and example notebooks are hosted at **Read the Docs**:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
https://fluxfootprint.readthedocs.io
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
To build locally:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pip install -r docs/requirements.txt
|
|
125
|
+
sphinx-build -M html docs/ docs/_build
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Input Requirements
|
|
131
|
+
|
|
132
|
+
| Column | Units | Description |
|
|
133
|
+
| ------------------------------- | ----- | ------------------------------ |
|
|
134
|
+
| `USTAR` | m s⁻¹ | Friction velocity, u\* |
|
|
135
|
+
| `V_SIGMA` | m s⁻¹ | Lateral velocity std. dev., σᵥ |
|
|
136
|
+
| `MO_LENGTH` | m | Monin–Obukhov length, L |
|
|
137
|
+
| `WD` | ° | Wind direction (0–360) |
|
|
138
|
+
| `WS` | m s⁻¹ | Mean wind speed at *zₘ* |
|
|
139
|
+
| *(optional)* `crop_height` | m | Canopy height, h\_c |
|
|
140
|
+
| *(optional)* `atm_bound_height` | m | Boundary‑layer height, h |
|
|
141
|
+
|
|
142
|
+
Any additional columns are ignored unless you plug in custom routines.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### Citing & Referencing
|
|
147
|
+
|
|
148
|
+
If you use *Flux-Footprints* in a publication, please cite the original
|
|
149
|
+
parameterisation:
|
|
150
|
+
|
|
151
|
+
> Kljun, N., Calanca, P., Rotach, M.W., & Schmid, H.P. (2015).
|
|
152
|
+
> **A simple two‑dimensional parameterisation for flux footprint prediction (FFP)**.
|
|
153
|
+
> *Geoscientific Model Development*, 8(11), 3695–3713.
|
|
154
|
+
> [https://doi.org/10.5194/gmd-8-3695-2015](https://doi.org/10.5194/gmd-8-3695-2015)
|
|
155
|
+
|
|
156
|
+
You may also cite the software directly (see `CITATION.cff`).
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Contributing
|
|
161
|
+
|
|
162
|
+
1. **Fork** → 2. **Create branch** → 3. **Commit changes**
|
|
163
|
+
2. **Run tests** (`pytest`) & linters (`pre‑commit run --all-files`)
|
|
164
|
+
3. **Open a pull‑request**
|
|
165
|
+
|
|
166
|
+
All contributions—bug reports, suggestions, or code—are welcome!
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Development Road‑map
|
|
171
|
+
|
|
172
|
+
* [ ] Footprint uncertainty quantification via Monte‑Carlo resampling
|
|
173
|
+
* [ ] GPU acceleration using CuPy
|
|
174
|
+
* [ ] Footprint aggregation across different time periods
|
|
175
|
+
* [ ] QGIS plug‑in for in‑map footprint visualisation
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### License
|
|
180
|
+
|
|
181
|
+
This project is licensed under the **MIT License** – see the
|
|
182
|
+
[`LICENSE`](LICENSE) file for details.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
*Happy footprinting!*
|
|
187
|
+
|
|
Binary file
|
|
Binary file
|