pahfit is a python package providing a decomposition model for astronomical infrared spectra, focusing on dust and gas emission features from the interstellar medium.

The original versions of PAHFIT (v1.x) were written in IDL and focused mainly on Spitzer/IRS spectroscopic observations. This python-based versions (>=v2.0) will provide expanded capabilities including more instrument (e.g., AKARI and JWST) and a more flexible modeling framework suitable for modeling a wider range of astrophysical sources.

For details for the IDL version of PAHFIT see Smith, J.D.T., Draine B.T., et al., 2007, ApJ, 656, 770.

This package is potentially an astropy affiliated package and uses the astropy.modeling framework.


GitHub: pahfit

Quick Start

Text, plots, and (potentially) code to quickly get a user fitting a spectrum.

Reporting Issues

If you have found a bug in pahfit please report it by creating a new issue on the pahfit GitHub issue tracker.

Please include an example that demonstrates the issue sufficiently so that the developers can reproduce and fix the problem.


Like the Astropy project, pahfit is made both by and for its users. We accept contributions at all levels, spanning the gamut from fixing a typo in the documentation to developing a major new feature. We welcome contributors who will abide by the Python Software Foundation Code of Conduct.

pahfit follows the same workflow and coding guidelines as Astropy. The following pages will help you get started with contributing fixes, code, or documentation (no git or GitHub experience necessary):

For the complete list of contributors please see the pahfit contributors page on Github.

Reference API

Base class for PAHFIT

pahfit.base Module


PAHFITBase([param_info, filename, tformat])

Base class for PAHFIT variants.

Class Inheritance Diagram

Inheritance diagram of pahfit.base.PAHFITBase

Component models not provided by astropy.models.

pahfit.component_models Module


BlackBody1D(amplitude, temperature, **kwargs)

Current astropy BlackBody1D does not play well with Lorentz1D and Gauss1D maybe, need to check again, possibly a units issue


Smith, Draine, et al.

Class Inheritance Diagram

Inheritance diagram of pahfit.component_models.BlackBody1D, pahfit.component_models.S07_attenuation