PhotoDissociation Region Toolbox — Python

Reliable astrophysics at everyday low, low prices! ®

Astrophysics Source Code Library 1102.022 Project Status: Active - The project has reached a stable, usable state and is being actively developed. Python version GNU GPL v3 License

pdrtpy is the new and improved version of the classic PhotoDissociation Region Toolbox, rewritten in Python with new capabilities and giving more flexibility to end users. (The Perl/CGI version of PDRT is deprecated and no longer supported).

The new PDR Toolbox will cover many more spectral lines and metallicities and allows map-based analysis so users can quickly compute spatial images of density and radiation field from map data. We provide Jupyter Example Notebooks for data analysis. It also can support models from other PDR codes enabling comparison of derived properties between codes.

The underlying model code has improved physics and chemistry. Critical updates include those discussed in Neufeld & Wolfire 2016, plus photo rates from Heays et al. 2017, oxygen chemistry rates from Kovalenko et al. 2018 and Tran et al. 2018, and carbon chemistry rates from Dagdigian 2019. We have also implemented new collisional excitation rates for [O I] from Lique et al. 2018 (and Lique private communication) and have included 13C chemistry along with the emitted line intensities for [13C II] and 13CO.

What is a PDR?

Photodissociation regions (PDRs) include all of the neutral gas in the ISM where far-ultraviolet (FUV) photons dominate the chemistry and/or heating. In regions of massive star formation, PDRS are created at the boundaries between the HII regions and neutral molecular cloud, as photons with energies 6 eV < h nu < 13.6 eV. photodissociate molecules and photoionize other elements. The gas is heated from photo-electrons and cools mostly through far-infrared fine structure lines like [O I] and [C II].

For a full review of PDR physics and chemistry, see Hollenbach & Tielens 1997.

Getting Started



pdrtpy requires Python 3 and recent versions of astropy, numpy, scipy, and matplotlib. If you want to run the Example Notebooks, you also need jupyter.

First make sure you are using Python 3:

python --version

should show e.g., 3.7.6.

Install the package

Python has numerous ways to install packages; the easiest is with pip. The code is hosted at the Python Packaging Index, so you can type:

pip install pdrtpy

If you do not have permission to install into your Python system package area, you will need to do a user-install, which will install the package locally.

pip install --user pdrtpy

Then go ahead and install the Example Notebooks.

Example Notebooks

We have prepared jupyter iPython notebooks with examples of how to use pdrtpy. You can download these as follows.

git clone

If you don’t have git, you can download a zip file of the repository.

To familiarize yourself with the capabilities of pdrtpy, we suggest you do the notebooks in this order:

  • PDRT_Example_Measurements.ipynb

  • PDRT_Example_ModelSets.ipynb

  • PDRT_Example_Model_Plotting.ipynb

  • PDRT_Example_Find_n_G0_Single_Pixel.ipynb

  • PDRT_Example_Make_n_G0_maps.ipynb

Module Descriptions and APIs

For Developers

If you plan to tinker with the code, you may want to try this installation method.

git clone
sudo apt-get install python3-venv
python -m venv ~/venv
source ~/venv/bin/activate
cd pdrtpy
pip install -r requirements.txt



pdrtpy is developed by Marc Pound and Mark Wolfire. This project is supported by NASA Astrophysics Data Analysis Program grant 80NSSC19K0573.