Interstellar Dust Extinction

dust_extinction is a python package to provide models of interstellar dust extinction curves.

Extinction describes the effects of dust on a single star. The dust along the line-of-sight to the stars removes flux by absorbing photons or scattering photons out of the line-of-sight. In general, extinction models are used to model or correct the effects of dust on observations a single star.

In contrast, dust attenuation refers to the effects of dust on the measurements of groups of stars mixed with dust or stars with circumstellar dust. See Extinction versus Attenuation. For attenuation models, see the dust_attenuation package.

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


GitHub: dust_extinction

Quick Start

How to extinguish (redden) and unextinguish (deredden) a spectrum:

Generate a spectrum to use. In this case a blackbody model, but can be an observed spectrum. The dust_extinction models are unit aware and the wavelength array should have astropy.units associated with it.

import numpy as np
from astropy.modeling.blackbody import blackbody_lambda
import astropy.units as u

# wavelengths and spectrum are 1D arrays
# wavelengths between 1000 and 30000 A
wavelengths = np.logspace(np.log10(1000), np.log10(3e4), num=1000)*u.AA
spectrum = blackbody_lambda(wavelengths, 10000*u.K)

Define a model, specifically the F99 model with an R(V) = 3.1.

from dust_extinction.parameter_averages import F99

# define the model
ext = F99(Rv=3.1)

Extinguish (redden) a spectrum with a screen of F99 dust with an E(B-V) of 0.5. Can also specify the dust column with Av (this case equivalent to Av = 0.5*Rv = 1.55).

# extinguish (redden) the spectrum
spectrum_ext = spectrum*ext.extinguish(wavelengths, Ebv=0.5)

Unextinguish (deredden) a spectrum with a screen of F99 dust with the equivalent A(V) column.

# unextinguish (deredden) the spectrum
spectrum_noext = spectrum_ext/ext.extinguish(wavelengths, Av=1.55)

(Source code, png, hires.png, pdf)


Reporting Issues

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

Please include an example that demonstrates the issue sufficiently so that the developers can reproduce and fix the problem. You may also be asked to provide information about your operating system and a full Python stack trace. The developers will walk you through obtaining a stack trace if it is necessary.


Like the Astropy project, dust_extinction 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.

dust_extinction 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 dust_extinction contributors page on Github.

Reference API

dust_extinction.averages Module


G03_SMCBar(*args[, meta, name]) G03 SMCBar Average Extinction Curve
G03_LMCAvg(*args[, meta, name]) G03 LMCAvg Average Extinction Curve
G03_LMC2(*args[, meta, name]) G03 LMC2 Average Extinction Curve
GCC09_MWAvg(*args[, meta, name]) G09 MW Average Extinction Curve

Class Inheritance Diagram

Inheritance diagram of dust_extinction.averages.G03_SMCBar, dust_extinction.averages.G03_LMCAvg, dust_extinction.averages.G03_LMC2, dust_extinction.averages.GCC09_MWAvg

dust_extinction.parameter_averages Module


CCM89([Rv]) CCM89 extinction model calculation
O94([Rv]) O94 extinction model calculation
F99([Rv]) F99 extinction model calculation
F04([Rv]) F99 extinction model calculation
VCG04([Rv]) VCG04 extinction model calculation
GCC09([Rv]) GCC09 extinction model calculation
M14([Rv]) M14 extinction model calculation
G16([RvA, fA]) G16 extinction model calculation
F20([Rv]) F20 extinction model calculation

Class Inheritance Diagram

Inheritance diagram of dust_extinction.parameter_averages.CCM89, dust_extinction.parameter_averages.O94, dust_extinction.parameter_averages.F99, dust_extinction.parameter_averages.F04, dust_extinction.parameter_averages.VCG04, dust_extinction.parameter_averages.GCC09, dust_extinction.parameter_averages.M14, dust_extinction.parameter_averages.G16, dust_extinction.parameter_averages.F20

dust_extinction.shapes Module


FM90([C1, C2, C3, C4, xo, gamma]) FM90 extinction model calculation
P92([BKG_amp, BKG_lambda, BKG_b, BKG_n, …]) P92 extinction model calculation

Class Inheritance Diagram

Inheritance diagram of dust_extinction.shapes.FM90, dust_extinction.shapes.P92

dust_extinction.conversions Module


AxAvToExv([Av]) Model to convert from A(x)/A(V) to E(x-V)

Class Inheritance Diagram

Inheritance diagram of dust_extinction.conversions.AxAvToExv

dust_extinction.baseclasses Module


BaseExtModel(*args[, meta, name]) Base Extinction Model.
BaseExtAveModel(*args[, meta, name]) Base Extinction Average.
BaseExtRvModel(*args[, meta, name]) Base Extinction R(V)-dependent Model.
BaseExtRvAfAModel(*args[, meta, name]) Base Extinction R(V)_A, f_A -dependent Model.

Class Inheritance Diagram

Inheritance diagram of dust_extinction.baseclasses.BaseExtModel, dust_extinction.baseclasses.BaseExtAveModel, dust_extinction.baseclasses.BaseExtRvModel, dust_extinction.baseclasses.BaseExtRvAfAModel