PhotoDissociation Region Toolbox — Python¶
Reliable astrophysics at everyday low, low prices! ®
pdrtpy is the new and improved version of the formerly web-based PhotoDissociation Region Toolbox, rewritten in Python with new capabilities and giving more flexibility to end users. (The web-based /CGI version of PDRT is deprecated and no longer supported).
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, 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 will cover 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.
The underlying PDR 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.
We also support fitting of temperatures and column densities to H2 excitation diagrams.
Up to date documentation can be found at pdrtpy.readthedocs.io.
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.
First make sure you are using Python 3:
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
For installation from github, see For Developers below.
Then 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.git
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:
Getting Help & Giving Feedback¶
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.
Contribute Code or Documentation¶
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.
If you plan to tinker with the code, you should fork the repo and work on your own fork. Point your browser to https://github.com/mpound/pdrtpy and click on fork in the upper right corner. After you have made your changes, create a pull request to merge them into the master branch.
You may want to use a virtual environment to protect from polluting your daily working environment (especially if you have a stable version of pdrtpy installed).
sudo apt-get install python3-venv python -m venv ~/pdrtpy_venv source ~/pdrtpy_venv/bin/activate[.csh] cd pdrtpy pip install -r requirements.txt pip install -e .
Module Descriptions and APIs¶
- Measurements: How you put observations to the Toolbox
- ModelSets: The interface to models in the Toolbox
- Plotting Tools: Display models and data
- Analysis Tools: Fit models to data
- Utilities: Various constants and methods used by the Toolbox
pdrtpy is developed by Marc Pound
and Mark Wolfire.
This project is supported by NASA Astrophysics Data Analysis Program
grant 80NSSC19K0573; from JWST-ERS program ID 1288 provided through
grants from the STScI under NASA contract NAS5-03127; and from the SOFIA C+ Legacy Project through a grant
from NASA through award #208378 issued by USRA.