petitRADTRANS documentation

Welcome to the petitRADTRANS (pRT) documentation. pRT is a Python package for calculating transmission and emission spectra of exoplanets for clear and cloudy planets. pRT also incorporates (new!) an easy subpackage for running retrievals with nested sampling.

To get started with some examples on how to run pRT immediately, see “Getting started”. Otherwise read on for some more general info, also on how to best run retrievals.

pRT has two different opacity treatment modes. The low resolution mode runs calculations at \(\lambda/\Delta\lambda\leq 1000\) using the so-called correlated-k treatment for opacities. The high resolution mode runs calculations at \(\lambda/\Delta\lambda\leq 10^6\), using a line-by-line opacity treatment.

pRT’s low-resolution opacities are initially stored at \(\lambda/\Delta\lambda = 1000\) but can be rebinned to lower resolution by the user, for which we make use of the Exo_k package. This is explained here.

The high-resolution opacities are initially stored at \(\lambda/\Delta\lambda = 10^6\), and example calculations are shown here. Opacities can also be undersampled, to run at a lower resolution, and to speed up spectral calculations. The user should verify whether this leads to solutions which are identical to the rebinned results of the fiducial \(\lambda/\Delta\lambda = 10^6\) resolution. Undersampling is done with the lbl_opacity_sampling parameter described in the API here. An example is given here.

pRT can calculate transmission and emission spectra of exoplanets, for clear or cloudy atmospheres. The different cloud treatments (gray clouds, power law clouds, “real” clouds using optical constants) are described in the tutorial here. Scattering is included in pRT, but must be specifically turned on for emission spectra (note that scattering increases the runtime), see Scattering for Emission Spectra. pRT can also calculate the reflection of light at the surface of rocky planets, for which the user can specify wavelength-dependent albedos and emissivities. This is likewise explained in Scattering for Emission Spectra.

The newly added retrieval subpackage is documented here. At the moment pRT retrievals are making use of the PyMultiNest package for parameter inference. Of course you are free to use pRT spectral synthesis routines with any other inference tool of your liking. For this you will have to setup your own retrieval framework, however (you can modify / check our source code for inspiration).

petitRADTRANS is available under the MIT License, and documented in Mollière et al. (2019), for the general code, and Mollière et al. (2020), Alei et al. (in prep.), for the scattering implementation. Please cite these papers if you make use of petitRADTRANS in your work.

This documentation webpage contains an installation guide, a tutorial, an API documentation. We also give a list of easy-to-use resources on how to include opacities that may be missing from our database. For the easiest cases this may correspond to simply dropping a file into the pRT opacity folder.


  • Paul Mollière

  • Evert Nasedkin

  • Eleonora Alei


  • Karan Molaverdikhani

  • Mantas Zilinskas