Reliable astrophysics at everyday low, low prices! ®
pdrtpy is the Python PhotoDissociation Region Toolbox. The current stable version is 3.0.1
The PDR Toolbox is a science-enabling tool for the community, designed to help astronomers determine the physical parameters of photodissociation regions from observations. Typical observations of both Galactic and extragalactic PDRs come from ground- and space-based millimeter, submillimeter, and far-infrared telescopes such as ALMA, SOFIA, JWST, Spitzer, STO, and Herschel. Given a set of observations of spectral line or continuum intensities, PDR Toolbox can compute best-fit FUV incident intensity and cloud density based on our models of PDR emission.
The PDR Toolbox covers a wide range of 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. It supports models from multiple PDR codes enabling comparison of derived properties between codes.
We suppoort PDR models from:
- The Wolfire-Kaufman PDR code which has physics and chemistry updates such as 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.
- The KOSMA-tau code, which supports spherical geometry.
We also support fitting of temperatures and column densities of excitation diagrams of H2, CO, 13CO. C18O, and CH+, in both single pixels and maps. Users can fit other molecules by providing appropriate transition data.
Up to date documentation can be found at pdrtpy.readthedocs.io.
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.
pdrtpy requires Python 3.11+ and recent versions of astropy, numpy, scipy, lmfit, and matplotlib. If you want to run the Example Notebooks, you also need jupyter.
The code is hosted at the Python Packaging Index, so you can type:
pip install pdrtpyIf 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 pdrtpygit clone https://github.com/mpound/pdrtpy
cd pdrtpy
uv sync
uv run ipythonThen go ahead and install the Example Notebooks.
We have prepared Jupyter iPython notebooks with examples of how to use pdrtpy. You can download these as follows.
git clone https://github.com/mpound/pdrtpy-nb.gitIf 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:
- Working with Measurements
- Introduction to ModelSets
- Exploring Models
- Determining Radiation Field and Intensity
- Image Radiation Field and Intensity for Maps
- Using Alternate Viewing Angle PDR Models to fit emission maps of the Horsehead.
- Fitting H2 Excitation Diagrams
- Fitting H2 Excitation on Spatial Maps
- Adding Custom Models
If you have a question or wish to give feedback about using PDR Toolbox or about the example notebooks, head on over to our PDR Toolbox online forum. There you can post your question and engage in discussion with the developers and other users. Feature requests from the community are welcome.
If you find a bug or something you think is in error, please report it on the github issue tracker. (You must have a Github account to submit an issue). If you aren't sure if something is a bug or not, or if you don't wish to create a Github account, you can post to the PDR Toolbox forum.
We welcome contributions and ideas to improve the PDR Toolbox! All contributors agree to follow our Code of Conduct . Please look at our Roadmap of Functionality to see the main new features we want to build. You can help out with those or suggest new features.
For developing pdrtpy code, we recommend the use of a python virtual environment. The example above uses uv. Before installing pdrtpy, developers should install uv following one of the methods in the uv docs. uv is the only tool that can sync the environment to the lockfile, so to install the known working development environment, uv is needed. If you plan to tinker with the code, you should fork the repo and work on your own fork. After you have made your changes, create a pull request to merge them into the master branch.
.