idlastro / Astronomical Utilities: CCM_UNRED

[Source code]

NAME
CCM_UNRED
PURPOSE
Deredden a flux vector using the CCM 1989 parameterization 
EXPLANATION
The reddening curve is that of Cardelli, Clayton, and Mathis (1989 ApJ.
345, 245), including the update for the near-UV given by O'Donnell 
(1994, ApJ, 422, 158).   Parameterization is valid from the IR to the 
far-UV (3.5 microns to 0.1 microns).    
Users might wish to consider using the alternate procedure FM_UNRED
which uses the extinction curve of Fitzpatrick (1999).
CALLING SEQUENCE
CCM_UNRED, wave, flux, ebv, funred, [ R_V = ]      
        or 
CCM_UNRED, wave, flux, ebv, [ R_V = ]      
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 deredenned.
OUTPUT
FUNRED - unreddened flux vector, same units and number of elements
        as FLUX
OPTIONAL INPUT KEYWORD
R_V - scalar specifying the ratio of total selective extinction
        R(V) = A(V) / E(B - V).    If not specified, then R_V = 3.1
        Extreme values of R(V) range from 2.75 to 5.3
EXAMPLE
Determine how a flat spectrum (in wavelength) between 1200 A and 3200 A
is altered by a reddening of E(B-V) = 0.1.   Assume an "average"
reddening for the diffuse interstellar medium (R(V) = 3.1)
  IDL> w = 1200 + findgen(40)*50      ;Create a wavelength vector
  IDL> f = w*0 + 1                    ;Create a "flat" flux vector
  IDL> ccm_unred, w, f, -0.1, fnew  ;Redden (negative E(B-V)) flux vector
  IDL> plot,w,fnew                   
NOTES
(1) The CCM curve shows good agreement with the Savage & Mathis (1979)
        ultraviolet curve shortward of 1400 A, but is probably
        preferable between 1200 and 1400 A.
(2)  Many sightlines with peculiar ultraviolet interstellar extinction 
        can be represented with a CCM curve, if the proper value of 
        R(V) is supplied.
(3)  Curve is extrapolated between 912 and 1000 A as suggested by
        Longo et al. (1989, ApJ, 339,474)
(4) Use the 4 parameter calling sequence if you wish to save the 
          original flux vector.
(5) Valencic et al. (2004, ApJ, 616, 912) revise the ultraviolet CCM
        curve (3.3 -- 8.0 um-1).    But since their revised curve does
        not connect smoothly with longer and shorter wavelengths, it is
        not included here.
REVISION HISTORY
Written   W. Landsman        Hughes/STX   January, 1992
Extrapolate curve for wavelengths between 900 and 1000 A   Dec. 1993
Use updated coefficients for near-UV from O'Donnell   Feb 1994
Allow 3 parameter calling sequence      April 1998
Converted to IDLV5.0                    April 1998