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 parallelisesuvspecover every point in your dataset and returns a labelled DatasetOne parameter system — literals, per-point
Var()references, and config overrides in a singleparamsmapping, validated against your installed libRadtran before anything runsReal 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 |
|
Run my first simulation |
|
Understand configs vs params |
|
Master the whole parameter system |
|
Add clouds / real atmospheres |
|
Debug a weird result |
|
See full research workflows |