Skip to main content

A complete Python wrapper for libRadtran radiative transfer

Project description

pyRadtran

CI PyPI License Docs

A complete Python wrapper for libRadtran radiative transfer simulations, built on Pydantic for validation and xarray for output.

Prerequisites

This library is a Python wrapper around libRadtran. You must install libRadtran (Fortran binary + data files) separately before using pyRadtran.

  1. Install libRadtran: Follow the official installation guide or use a package manager:

    • conda: conda install -c conda-forge libradtran
    • apt (Debian/Ubuntu): sudo apt install libradtran
    • Source: Download from libradtran.org and compile with make
  2. Set the data path: Ensure the libRadtran data directory is available. You will pass it to Runner.execute(...) via the data_path argument (e.g. /usr/local/share/libRadtran/data).

Installation

pip install pyradtran

With optional plotting support:

pip install pyradtran[plot]

For development:

git clone https://github.com/openEarthModelling/pyRadtran.git
cd pyRadtran
pip install -e ".[dev]"

Quick Start

from pyradtran import Scene, Runner

scene = (
    Scene()
    .set_atmosphere(profile="us", altitude=2.663)
    .set_source_solar(sza=30.0)
    .set_wavelength(250.0, 1200.0)
    .set_solver(method="disort", streams=16)
    .set_output(quantities=["lambda", "edir"], quantity="transmittance")
)

result = Runner.execute(scene, data_path="/usr/local/share/libRadtran/data")
result.edir.plot()

See the documentation for more examples, including aerosol configurations, 3D scenes, and satellite simulations.

Key Features

  • Fluent Scene Builder — configure atmospheres, sources, wavelengths, solvers, and aerosols through a chainable API.
  • Aerosol Modelling — OPAC presets, custom OPAC, external aerosol files, and composite aerosols with Mie scattering.
  • Convenience Functions — pre-configured setups for 3D, cloudy, lidar, polarized, satellite, solar, and thermal simulations.
  • Type-Safe — built on Pydantic v2 for runtime validation and excellent IDE autocompletion.
  • Typed — ships py.typed for full type-checker support.

Documentation

Full documentation is hosted on GitHub Pages, including API reference, tutorials, and example notebooks.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines on development setup, testing, and submitting pull requests.

License

This project is licensed under the MIT License.

Note: pyRadtran calls the libRadtran binary at runtime. libRadtran is licensed under the GNU GPL v2. Because pyRadtran interacts with libRadtran as a separate program (via subprocess), the pyRadtran code itself is not considered a derivative work under the GPL and is released under the MIT license. Users who use pyRadtran must comply with both the MIT terms and the libRadtran GPL terms.

Citation

If you use pyRadtran in your research, please cite it. A CITATION.cff file is included in this repository for your convenience.

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

pyradtran-0.1.0.tar.gz (64.0 kB view details)

Uploaded Source

Built Distribution

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

pyradtran-0.1.0-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file pyradtran-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for pyradtran-0.1.0.tar.gz
Algorithm Hash digest
SHA256 843804814e8e5ffdeb6965aac1b5e4f1c38ee8879a2451fb1ade07726a45d228
MD5 38cc4c6d686afe62f23219a552da3de8
BLAKE2b-256 0bd930bf67655d8757adf19c0305e2e7ba42c036c124ac39a7d135e3a99b9356

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyradtran-0.1.0.tar.gz:

Publisher: publish.yml on openEarthModelling/pyRadtran

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

File details

Details for the file pyradtran-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pyradtran-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53ae02e26f2006b3d3a6bdec438088b8fb33bc8df74ddb2f8da84273646bdfdd
MD5 a32bda884381eb667486886f4d23e71c
BLAKE2b-256 d54270b5e7e7226bba36220b7bcb5e5c510b475319aaa2d8dac0143d8a10b543

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyradtran-0.1.0-py3-none-any.whl:

Publisher: publish.yml on openEarthModelling/pyRadtran

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