Deredden flux vector (unred)

PyAstronomy.pyasl.unred(wave, flux, ebv, R_V=3.1, LMC2=False, AVGLMC=False)

Deredden a flux vector using the Fitzpatrick (1999) parameterization

Parameters
wavearray

Wavelength in Angstrom

fluxarray

Calibrated flux vector, same number of elements as wave.

ebvfloat, optional

Color excess E(B-V). If a negative ebv is supplied, then fluxes will be reddened rather than dereddened. The default is 3.1.

AVGLMCboolean

If True, then the default fit parameters c1,c2,c3,c4,gamma,x0 are set to the average values determined for reddening in the general Large Magellanic Cloud (LMC) field by Misselt et al. (1999, ApJ, 515, 128). The default is False.

LMC2boolean

If True, the fit parameters are set to the values determined for the LMC2 field (including 30 Dor) by Misselt et al. Note that neither AVGLMC nor LMC2 will alter the default value of R_V, which is poorly known for the LMC.

Returns
new_fluxarray

Dereddened flux vector, same units and number of elements as input flux.

Notes

Note

This function was ported from the IDL Astronomy User’s Library.

IDL - Documentation
PURPOSE:

Deredden a flux vector using the Fitzpatrick (1999) parameterization

EXPLANATION:

The R-dependent Galactic extinction curve is that of Fitzpatrick & Massa (Fitzpatrick, 1999, PASP, 111, 63; astro-ph/9809387 ). Parameterization is valid from the IR to the far-UV (3.5 microns to 0.1 microns). UV extinction curve is extrapolated down to 912 Angstroms.

CALLING SEQUENCE:
FM_UNRED, wave, flux, ebv, [ funred, R_V = , /LMC2, /AVGLMC, ExtCurve=

gamma =, x0=, c1=, c2=, c3=, c4= ]

INPUT:

WAVE - wavelength vector (Angstroms) FLUX - calibrated flux vector, same number of elements as WAVE

If only 3 parameters are supplied, then this vector will updated on output to contain the dereddened flux.

EBV - color excess E(B-V), scalar. If a negative EBV is supplied,

then fluxes will be reddened rather than dereddened.

OUTPUT:
FUNRED - unreddened flux vector, same units and number of elements

as FLUX

OPTIONAL INPUT KEYWORDS
R_V - scalar specifying the ratio of total to selective extinction

R(V) = A(V) / E(B - V). If not specified, then R = 3.1 Extreme values of R(V) range from 2.3 to 5.3

/AVGLMC - if set, then the default fit parameters c1,c2,c3,c4,gamma,x0

are set to the average values determined for reddening in the general Large Magellanic Cloud (LMC) field by Misselt et al. (1999, ApJ, 515, 128)

/LMC2 - if set, then the fit parameters are set to the values determined

for the LMC2 field (including 30 Dor) by Misselt et al. Note that neither /AVGLMC or /LMC2 will alter the default value of R_V which is poorly known for the LMC.

The following five input keyword parameters allow the user to customize the adopted extinction curve. For example, see Clayton et al. (2003, ApJ, 588, 871) for examples of these parameters in different interstellar environments.

x0 - Centroid of 2200 A bump in microns (default = 4.596) gamma - Width of 2200 A bump in microns (default =0.99) c3 - Strength of the 2200 A bump (default = 3.23) c4 - FUV curvature (default = 0.41) c2 - Slope of the linear UV extinction component

(default = -0.824 + 4.717/R)

c1 - Intercept of the linear UV extinction component

(default = 2.030 - 3.007*c2

Example of usage

from PyAstronomy import pyasl
import numpy as np
import matplotlib.pylab as plt

# Approximate a solar spectrum using a Planck
# function with a temperature of 5778 K between
# 3000 A and 8000 A.
wvl = np.arange(3000., 8000., 1.0)
flux = pyasl.planck(T=5778., lam=wvl*1e-10)

# Deredden the spectrum assuming ebv=0.1
fluxUnred = pyasl.unred(wvl, flux, ebv=0.1, R_V=3.1)

# Plot the result
plt.title("Reddened flux (red) and dereddened flux (blue)")
plt.plot(wvl, flux, 'r--')
plt.plot(wvl, fluxUnred, 'b--')
plt.show()