Skip to main content

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.

Citation

If you use atmoflux in academic work, please cite the software using the DOI provided below.

Each release is archived via Zenodo and assigned a permanent DOI to ensure reproducibility.

The recommended citation format is available in CITATION.cff and via the “Cite this repository” button on GitHub.

DOI: https://doi.org/10.5281/zenodo.20470203

Requirements

  • Python ≥ 3.9 (developed and tested in 3.12)
  • NumPy ≥ 1.26 — 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/Telluris-Labs/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

Atmospheric state

Module Description
temperature Unit conversion, dew point, potential, virtual, wet-bulb and equivalent potential temperature, lapse rates, surface temperature from longwave
humidity Saturation and actual vapor pressure (water and ice), relative and specific humidity, mixing ratio, vapor pressure deficit, absolute humidity, precipitable water
wind Speed unit conversion, vector components, log and power-law profiles, friction velocity, shear, wind power density, canopy-derived roughness and displacement
atmosphere Scale height, barometric pressure with altitude, hypsometric thickness, density altitude, US Standard Atmosphere profile

Radiation

Module Description
solar Solar declination, hour angle, zenith and elevation, daylight hours, extraterrestrial and clear-sky shortwave radiation
radiative Blackbody emission, net shortwave and longwave (clear-sky and cloud-adjusted), net radiation, clear-sky emissivity, diffuse fraction

Surface fluxes

Module Description
turbulent Air density, bulk-aerodynamic sensible and latent heat fluxes, transfer coefficients, surface shear stress, aerodynamic resistance
stability Bulk Richardson number, Obukhov length, stability parameter and correction functions, stability classification
hydro Latent-heat-to-evaporation conversion, Penman, Penman-Monteith, FAO-56 reference ET, Priestley-Taylor, Hargreaves, equilibrium evaporation
aerosols Gravitational settling, dry deposition, surface emission flux
balance Energy budget residual, Bowen ratio, available energy, energy balance ratio, ground heat fraction, EnergyBalance assembly

Core & utilities

Module Description
core Shared data structures, including the EnergyBalance and AtmosphericState containers
constants Physical and derived constants with documented units
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

atmoflux-1.1.0.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

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

atmoflux-1.1.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file atmoflux-1.1.0.tar.gz.

File metadata

  • Download URL: atmoflux-1.1.0.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for atmoflux-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b1e3ea7947bf96f2fe57ad2c10d671d30c7bcbcb243f9118db53c8aba147422a
MD5 ba6602fde0f30a2b55b7bfcce40b0090
BLAKE2b-256 152bb6b1cc2d4e2d087f225871dc2392cfee5193e8e5ac0226289dd997b6731e

See more details on using hashes here.

File details

Details for the file atmoflux-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: atmoflux-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for atmoflux-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0edb3e7a87908d6d38c2b8303fdb3d2a95d9794a93704dbe54690bb09696243d
MD5 3e128b1df3a2c2a86c1db40dc565c373
BLAKE2b-256 162dc0bc1d1f509e1711d953681f3249a0f48674d01f62dc08b35b5a3b71c695

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