petitRADTRANS: exoplanet spectra for everyone!

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

pRT Version 3 is coming up! petitRADTRANS 3 comes with a lot of quality-of-life features, optimization, and code rationalization, but also with breaking changes. Read here for a summary of the pRT 3 improvements and changes.

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’s different cloud treatments (gray clouds, power law clouds, “real” clouds using optical constants, user-specified opacity functions) 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 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’s 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. (2022), for the scattering implementation. Please cite these papers if you make use of petitRADTRANS in your work. If you are interested in contributing to petitRADTRANS, feel free to reach out to the development team about your contibution. New features can be added by forking the package from gitlab, implementing your feature, and submitting a pull request.

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

  • Doriann Blain

  • Eleonora Alei

  • Tomas Stolker

  • Nick Wogan


  • Karan Molaverdikhani

  • Mantas Zilinskas