Skip to main content

Python library for atmospheric thermodynamic calculations

Project description

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_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

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

atmoslib-2.4.1.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

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

atmoslib-2.4.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file atmoslib-2.4.1.tar.gz.

File metadata

  • Download URL: atmoslib-2.4.1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atmoslib-2.4.1.tar.gz
Algorithm Hash digest
SHA256 3158e537e81c5bc74985c50ce83512ea1234e0867eb4c13861d949e887f1e9c0
MD5 da782a997a0d63fb76c12af8383d1e9f
BLAKE2b-256 406a2666c902e4a76d57cdaa997273a62553b90eaecd799daafa838b0f9a9b6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for atmoslib-2.4.1.tar.gz:

Publisher: publish.yml on actris-cloudnet/atmoslib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atmoslib-2.4.1-py3-none-any.whl.

File metadata

  • Download URL: atmoslib-2.4.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atmoslib-2.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6443129f9280eb3fe6e750d49851af319ef293580784731c82556994552c5010
MD5 87a6e5b23bd39c486e6ced7f680920e0
BLAKE2b-256 35c86cf565c749ccc4769799cb7976da64aa5bee2e5737f850008674a64d83c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for atmoslib-2.4.1-py3-none-any.whl:

Publisher: publish.yml on actris-cloudnet/atmoslib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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