DustExtinction#

m4opt.synphot.extinction.DustExtinction(Ebv=None)[source] [edit on github]#

Milky Way dust extinction.

Parameters:

Ebv (float | None) – Reddening color excess, \(E(B-V)\).

Notes

We use dust_extinction.parameter_averages.G23 because of its broad wavelength coverage from ultraviolet to infrared.

Examples

You can create an extinction model with an explicitly set value of E(B-V):

>>> from astropy import units as u
>>> from m4opt.synphot.extinction import DustExtinction
>>> extinction = DustExtinction(Ebv=1.0)
>>> extinction(10 * u.micron)
<Quantity 0.78756244>

Or you can leave it unspecified, to evaluate later for a given sky location using m4opt.synphot.observing():

>>> from astropy.coordinates import EarthLocation, SkyCoord
>>> from astropy.time import Time
>>> from m4opt.synphot import observing
>>> extinction = DustExtinction()
>>> with observing(EarthLocation.of_site("Las Campanas Observatory"), SkyCoord.from_name("NGC 4993"), Time("2017-08-17")):
...     extinction(10 * u.micron)
<Quantity 0.9748155>