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.

User Documentation



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



Old implementation.

Class Inheritance Diagram

Inheritance diagram of pahfit.base.PAHFITBase

Component models not provided by astropy.models.

pahfit.component_models Module


BlackBody1D(amplitude, temperature, **kwargs)

A blackbody component.

ModifiedBlackBody1D(amplitude, temperature, ...)

Modified blackbody with an emissivity propoportional to nu^2


Smith, Draine, et al. (2007) kvt attenuation model calculation.

att_Drude1D(tau, x_0, fwhm, **kwargs)

Attenuation components that can be parameterized by Drude profiles.

Class Inheritance Diagram

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