Skip to main content

atmoslib

CI PyPI version

Python library for atmospheric thermodynamics and microwave attenuation calculations. This library is used in CloudnetPy and related projects with focus on performance and minimal dependencies.

Installation

pip install atmoslib

Usage

import numpy as np
import atmoslib

t = np.array([293.15, 283.15, 273.15])     # temperature (K)
p = np.array([101325.0, 95000.0, 90000.0]) # pressure (Pa)
q = np.array([0.010, 0.005, 0.001])        # specific humidity (kg/kg)

tw = atmoslib.wet_bulb_temperature(t, p, q)

Most inputs accept scalars or NumPy arrays of any shape (broadcasting follows NumPy rules).

Available functions

Function Description
vapor_pressure(p, q) Vapor pressure of water (Pa)
saturation_vapor_pressure(t) Saturation vapor pressure (Pa, Goff-Gratch, liquid/ice/mixed)
mixing_ratio(vp, p) Mixing ratio (kg kg⁻¹)
specific_humidity(t, p, rh) Specific humidity (kg kg⁻¹, liquid/ice/mixed)
relative_humidity(t, p, q) Relative humidity (0–1, liquid/ice/mixed)
absolute_humidity(t, vp) Absolute humidity (kg m⁻³)
dew_point_temperature(t, rh) Dew-point temperature (K, Magnus)
virtual_temperature(t, q) Virtual temperature (K)
potential_temperature(t, p) Potential temperature (K)
equivalent_potential_temperature(t, p, q) Equivalent potential temperature (K, Bolton 1980)
wet_bulb_temperature(t, p, q) Wet-bulb temperature (K, iterative)
latent_heat_of_vaporization(t) Latent heat of vaporization (J kg⁻¹)
air_density(t, p, mr) Moist-air density (kg m⁻³)
adiabatic_lwc_gradient(t, p) Adiabatic vertical gradient of LWC at cloud base (kg m⁻³ m⁻¹, Brenguier 1991)
hydrostatic_pressure(t, q, z, p_sfc) Pressure profile from surface value via hypsometric equation (Pa)
isa_pressure(gph) Pressure from geopotential height (Pa, ISA)
isa_temperature(gph) Temperature from geopotential height (K, ISA)
isa_air_density(gph) Air density from geopotential height (kg m⁻³, ISA)
isa_altitude(t, p) Geopotential height from pressure and temperature (gpm, ISA)
geometric_height(gph) Geometric height from geopotential height (m, ECMWF)
c2k(t) / k2c(t) Celsius ↔ Kelvin conversion
liquid_water_specific_attenuation(t, f) Cloud liquid water specific attenuation (dB km⁻¹ per g m⁻³, ITU-R P.840)
gas_specific_attenuation(t, p, e, f) Dry-air + water-vapor specific attenuation (dB km⁻¹, ITU-R P.676)
rain_specific_attenuation(R, f) Rain specific attenuation (dB km⁻¹, ITU-R P.838)

See the docstrings for argument details and references.

License

MIT

Metadata

Release files for atmoslib 2.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atmoslib 2.4.2
File Size Uploaded
atmoslib-2.4.2.tar.gz 26.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atmoslib 2.4.2
File Interpreter ABI Platform
atmoslib-2.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.7 kB

Release files / atmoslib-2.4.2.tar.gz

Download URL atmoslib-2.4.2.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e1b7d23c24715e39030c69ec5b5dcdce3d402320f1ccc0dfb41a3b05b3456251
BLAKE2b-256 checksum
How to use checksums
091133539f6fce474de50a7a0171ceda34a141091aa16ced9822c6c3a1aa4811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / atmoslib-2.4.2-py3-none-any.whl

Download URL atmoslib-2.4.2-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b56840d210a000bb6b6c23490fe3ca825493f3b5f5fa54b4729b332a70728112
BLAKE2b-256 checksum
How to use checksums
8bda635dd5eccb4860a3d8544e78449cd2e18abfdbf91dbae070c3738f9b8673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.4.2 This release

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page