Skip to content
A line-by-line radiation code for planetary atmospheres. Now with shortwave radiative transfer.
Fortran Python Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


PyRADS is the Python line-by-line RADiation model for planetary atmosphereS. PyRADS is a radiation code that can provide line-by-line spectral resolution, yet is written in Python and so is flexible enough to be useful in teaching.

For Earth-like atmospheres, PyRADS currently uses HITRAN 2016 line lists ( and the MTCKD continuum model (

This version of PyRADS tackles shortwave calculations using the DISORT radiative solver.


(1) Koll & Cronin, 2018,

(2) Koll & Cronin, 2019,

(3) Stamnes et al, 1988, Applied Optics.


  1. Download to your own computer.

  2. Manually compile the MTCKD model:

  • cd $PyRADS/DATA/MT_CKD_continuum/cntnm.H2O_N2/build
  • (on a Mac) make -f make_cntnm osxGNUdbl
  • (on a Mac if you are using gfortran installed with conda) make -f make_cntnm osxGNUCONDAdbl
  1. Manually install the pyDISORT wrapper, which solves the radiative transfer equations with scattering (=in the shortwave). Steps marked with (x) use conda to create a separate environment, and are optional.
  • (x) conda create --clone base --name base_w_pyDISORT

  • (x) source activate base_w_pyDISORT

  • cd $PyRADS/pyDISORT-master

  • python install

    To test whether pyDISORT was successfully installed:

  • cd $PyRADS/pyDISORT-master/test

  • python

  • python

    If the installation failed, the test scripts will return "ImportError: No module named disort". If the installation worked, the test scripts will print a large slew of output. If using a separate conda environment, later remember to load that environment with 'source activate' before running pyDISORT or importing pyRADS.

  1. Run test scripts

To compute outgoing longwave radiation (OLR) in W/m2 for a given surface temperature:

  • cd $PyRADS/Test01.olr
  • python

To compute OLRs for a set of surface temperatures and save the resulting output to txt:

  • cd $PyRADS/Test02.runaway
  • python

To compute SW fluxes in W/m2 for a given surface temperature (here, 300 K) over a limited part of the solar spectrum (here, 1000-2000 cm-1) at some resolution (here, 1 cm-1; see note below) and save the resulting output to txt file in the same directory ("."):

  • cd $PyRADS/Test03.sw
  • python 1000. 2000. 1. 300. .

To stitch together the SW fluxes across the entire solar spectrum (takes a while even at low spectral res; see note below):

  • cd $PyRADS/Test04.sw_full_spectrum
  • python 1000. 10000. 1. 300. .
  • python 10000. 20000. 1. 300. .
  • python 20000. 30000. 1. 300. .
  • python 30000. 90000. 10. 300. .
  • python

NOTE: computing opacities + running pyDISORT over the entire solar spectrum becomes computationally very costly. It is much faster to split the spectral calculations up over many spectral chunks, distribute those over parallel processors, and them combine the spectral resolved calculations at the end. Use to combine discrete chunks of the spectrum.

NOTE: spectral resolution should reflect the available data. E.g., HITRAN2016 doesn't contain H2O lines beyond ~25000 cm-1, so there is no need to retain high spectral resolution in the UV.

NOTE: resolution in test scripts was chosen for relative speed, not accuracy. For research-grade output and model intercomparisons, vertical and spectral resolution need to be increased. For some reference values, see Methods in Koll & Cronin (2018) and Koll & Cronin (2019).


Python 2 or 3 with numpy and scipy.

For the MTCKD continuum model: gmake and gfortran.

For the pyDISORT radiation solver: see


PyRADS makes use of HITRAN 2016 line lists (, AER's MTCKD continuum model (, and the PyTran script published by Ray Pierrehumbert as part of the courseware for "Principles of Planetary Climates" ( Brian Rose ( has helped improve the code. The SW version of PyRADS uses DISORT, developed by Stamnes et al, and the pyDISORT wrapper, developed by chanGimeno (

You can’t perform that action at this time.