nanodisort documentation¶
Date: Jun 02, 2026 | Version: 0.2.0
nanodisort provides Python bindings for CDISORT, a C implementation of the DISORT (Discrete Ordinates Radiative Transfer) program for solving the radiative transfer equation.
Overview¶
DISORT is a widely-used solver for radiative transfer in plane-parallel atmospheres. It uses the discrete ordinates method to solve the radiative transfer equation, handling:
Multiple scattering
Absorption and emission
Various boundary conditions
Thermal emission (Planck function)
Pseudo-spherical geometry for the direct beam
The CDISORT library is a C translation of the original Fortran DISORT code, offering improved performance through dynamic memory allocation and full double precision arithmetic.
Installation¶
pip install nanodisort
Prerequisites:
Supported platforms: Linux, macOS
Python 3.9 to 3.13
NumPy 1.20 or later
Quickstart¶
import nanodisort as nd
# Create solver state
state = nd.DisortState()
# Configure dimensions
state.nstr = 8 # Number of streams
state.nlyr = 6 # Number of layers
state.nmom = 8 # Number of phase function moments
state.ntau = 5 # Number of output optical thicknesses
state.numu = 4 # Number of output polar angles
state.nphi = 3 # Number of output azimuthal angles
# Allocate memory
state.allocate()
# Set optical properties, geometry, boundary conditions
# ... (see API documentation)
# Solve
state.solve()
Why another Python DISORT wrapper?¶
This project fills a specific niche that was not addressed by existing Python-centric DISORT implementations or wrappers. Hereafter follows a non-exhaustive review of existing solutions and how nanodisort relates to them.
- Fortran and C DISORT implementations
This Fortran implementation [Stamnes et al., 1988, Stamnes et al., 2000] has issues that were solved later by CDISORT. The CDISORT paper [Buras et al., 2011] motivates the CDISORT project and explains why we decided to wrap CDISORT rather than DISORT.
- pydisort
This project wraps CDISORT as well, with pybind11. Its goals differ from this project’s in that nandisort has more modest ambitions: we do not aim to expose a specific C++ interface to CDISORT, and we do not seek integration with ML frameworks.
- Pythonic-DISORT
This project is very different from nanodisort: it is a reimplementation of the original DISORT algorithm in Python. It uses Numpy and vectorizes many performance-critical operations, which makes it a serious alternative to consider for people who want to use the original DISORT in Python. It also provides a comprehensive introduction to DISORT.
- pyDISORT
This project wraps the Fortran implementation of DISORT (with minimal changes) at a low level and is, in its philosophy, similar to nanodisort.
- pyRT_DISORT
This package assists pyDISORT users in the creation of their input and does not provide radiative transfer simulation features directly.
Knowing that, the following major goals we set and choices we made for nanodisort are:
A thin Python wrapper around CDISORT: there is no intermediate C++ API.
An API that is as close to the CDISORT API as possible: no hidden operations, only error handling has been modified to allow raising exceptions instead of terminating execution.
Full interoperability with Numpy buffers: all input data arrays can be assigned NumPy data.
Lightweight: no required dependency on large computational frameworks (e.g. PyTorch, JAX or TensorFlow).
Acknowledgments¶
nanodisort authors are grateful to the developers of the many implementations of DISORT, and, in particular, to
Timothy E. Dowling (original CDISORT C translation);
Robert Buras (phase function extensions);
Arve Kylling (pseudo-spherical approximation, testing);
the original DISORT Fortran authors (Knuth Stamnes, Si-Chee Tsay, Warren Wiscombe and Kolf Jayaweera).
Citation¶
If you use nanodisort in your research, please cite the CDISORT paper [Buras et al., 2011] and the nanodisort repository:
@software{Leroy_nanodisort,
author = {Leroy, Vincent and Emde, Claudia},
license = {GPL-3.0-or-later},
title = {{nanodisort}},
url = {https://github.com/eradiate/nanodisort},
version = {0.1.0}
}
License¶
nanodisort is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later), consistent with the CDISORT library it wraps.