Atmospheric and energy flux analysis library by Telluris Labs
Project description
atmoflux
A Python package for atmospheric and surface flux calculation and analysis.
Overview
atmoflux is a Python library for atmospheric and surface flux calculations relevant to climate, micrometeorology, and urban environmental research. The package provides modular tools for radiative, turbulent, hydrological, aerosol, and energy balance calculations, alongside supporting utilities for atmospheric state variables and physical constants.
The atmoflux library emphasizes physically explicit formulations and transparent diagnostics, supporting process-based analysis and integration with statistical or machine learning models. All functions accept scalars or NumPy arrays, so calculations vectorize naturally over gridded or time-series data.
atmoflux is being developed alongside dissertation research focused on urban microclimates, heat stress, and land–atmosphere interactions, and is intended to evolve as a flexible research framework rather than a fixed operational model.
Requirements
- Python ≥ 3.9
- NumPy ≥ 1.22 — the only runtime dependency
Keeping the dependency footprint minimal is a deliberate design goal; NumPy is the sole external requirement.
Installation
From PyPI (recommended)
pip install atmoflux
From source
Clone the repository and install from the project root. Use an editable install if you intend to modify the code:
git clone https://github.com/TellurisLabs/atmoflux.git
cd atmoflux
pip install . # regular installation
pip install -e . # editable (development) installation
Quick Start
import atmoflux as af
# Net all-wave radiation at a surface (W/m²)
rn = af.radiative.net_radiation(
sw_down=800, lw_down=350, albedo=0.2, temp_surface=295
)
# Turbulent sensible heat flux via the bulk-aerodynamic method
rho = af.turbulent.air_density(temp=22, pressure=101.325)
h = af.turbulent.sensible_heat_flux(
rho, wind_speed=3.0, temp_air=22, temp_surface=25, transfer_coeff=0.0013
)
# Assemble a surface energy balance with derived diagnostics
eb = af.balance.energy_balance(
rn, sensible_heat=h, latent_heat=250, ground_heat=60
)
print(eb.residual) # closure residual (W/m²)
print(eb.bowen_ratio) # H / LE
Modules
State variables
| Module | Description |
|---|---|
temperature |
Unit conversion, dew point, potential and virtual temperature, lapse rate, surface temperature from longwave |
humidity |
Saturation and actual vapor pressure, relative and specific humidity, mixing ratio, vapor pressure deficit, absolute humidity |
wind |
Speed unit conversion, vector components, log and power-law profiles, friction velocity, shear |
Flux / process
| Module | Description |
|---|---|
radiative |
Blackbody emission, net shortwave and longwave, net radiation, clear-sky emissivity |
turbulent |
Air density, bulk-aerodynamic sensible and latent heat fluxes, transfer coefficients |
hydro |
Latent-heat-to-evaporation conversion, Penman, Penman-Monteith, FAO-56 reference ET |
aerosols |
Gravitational settling, dry deposition, surface emission flux |
balance |
Energy budget residual, Bowen ratio, EnergyBalance assembly |
Support
| Module | Description |
|---|---|
constants |
Physical and derived constants with documented units |
core |
Shared data structures, including the EnergyBalance container |
exceptions |
Package exception hierarchy rooted at AtmofluxError |
Testing
The package ships with a pytest suite mirroring the module structure, plus doctests in every public function.
# Unit tests
pytest atmoflux/tests/
# Docstring examples
pytest --doctest-modules atmoflux/
License
Released under the MIT License. See the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atmoflux-1.0.0.tar.gz.
File metadata
- Download URL: atmoflux-1.0.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
085b815297b01c73780268cc19107d6b872517b165c2f405a47471167c7f4a4d
|
|
| MD5 |
b15e8eb7e0238bc9d6ff30d77dfb5aaf
|
|
| BLAKE2b-256 |
2448c23045f42b098adb59a02d6b39f731f194a7be92203ec27fd5de4514b9ad
|
File details
Details for the file atmoflux-1.0.0-py3-none-any.whl.
File metadata
- Download URL: atmoflux-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce07c6567314d3652cf79fa464ee07d6d026959115c211bf743da984e92754d1
|
|
| MD5 |
91639d9cd64ed4c125797acb0f07a699
|
|
| BLAKE2b-256 |
98996cf8ba51c36e9aa88eadf3bcb1c90c17758564dcdae0fab3caea0625ec76
|