pyRadtran#

A Python interface for the libRadtran radiative transfer model: set up, run, and analyse solar and thermal simulations directly from xarray datasets.

  • xarray-native — one ds.pyradtran.run() call parallelises uvspec over every point in your dataset and returns a labelled Dataset

  • One parameter system — literals, per-point Var() references, and config overrides in a single params mapping, validated against your installed libRadtran before anything runs

  • Real atmospheres — standard profiles, IGRA radiosondes, ERA5 reanalysis; parametric and file-based clouds

  • Post-processing built in — instrument-channel convolution, brightness temperatures, finite-difference sensitivity kernels

Three steps to a first result#

import pyradtran   # registers the .pyradtran accessor
import xarray as xr, pandas as pd

# 1. Describe *where and when* as an xarray dataset
ds = xr.Dataset(coords={
    'time': pd.date_range('2025-04-04', periods=24, freq='h'),
    'latitude': ('time', [61.0] * 24),
    'longitude': ('time', [22.0] * 24),
})

# 2. Run (config = *how*: solver, spectral range, outputs)
ds_sim = ds.pyradtran.run(config_path='config/spectral_config.yaml')

# 3. Analyse like any xarray dataset
ds_sim.eglo.sel(wavelength=550, method='nearest').plot()

Where to go next#

I want to…

Go to

Install and configure paths

Installation

Run my first simulation

PyRadtran Quickstart

Understand configs vs params

Configuration, Parameters & Validation

Master the whole parameter system

The Parameter System: A Deep Dive

Add clouds / real atmospheres

Advanced: Water Clouds, Quickstart: ERA5 Atmosphere

Debug a weird result

Debugging

See full research workflows

Notebook Gallery