Skip to main content

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. GNU GPL v3 License Documentation status Contributor Covenant Code of Conduct CI Workflow Build Status pre-commit.ci status

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:

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.

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

Installation

Requirements

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.

Install the package

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

From github

git clone https://github.com/mpound/pdrtpy
cd pdrtpy
uv sync
uv run ipython

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 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.

Reporting Issues

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.

For Developers

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.

.

Metadata

Release files for pdrtpy 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdrtpy 3.0.1
File Size Uploaded
pdrtpy-3.0.1.tar.gz 59.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdrtpy 3.0.1
File Interpreter ABI Platform
pdrtpy-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 126.6 MB

Release files / pdrtpy-3.0.1.tar.gz

Download URL pdrtpy-3.0.1.tar.gz
Size 59.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d2d140792784d229d58bc8eddf0e6101fbc6f7af1ab508ef0cd24a46e0c7ca63
BLAKE2b-256 checksum
How to use checksums
5638fe29f6af84a44239c07ea5aa3d8704db903d80784005be6ea0de1617c88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / pdrtpy-3.0.1-py3-none-any.whl

Download URL pdrtpy-3.0.1-py3-none-any.whl
Size 66.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7d5682d45653306f9b148a4a25adb924aa7ddf352c99339fc531c6c093c55c8c
BLAKE2b-256 checksum
How to use checksums
0b37294d635a5a7438fbe5b828efb4d3d30d7b57752df47e8a94f672f2aebdda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

2.6.4

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.1.1

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page