Commit 1fc63145 authored by Médéric Boquien's avatar Médéric Boquien

Add two new attenuation modules based on modified Charlot & Fall (2000) and Calzetti (2000) laws.

parent ecb82506
......@@ -4,7 +4,8 @@
### Added
- It is now possible to optionally indicate the distance in Mpc in the input file. If present it will be used in lieu of the distance computed from the redshift. This is especially useful in the nearby universe where the redshift is a very poor indicator of the actual distance. (Médéric Boquien)
- It is now possible to fit any physical property indicated by the code (e.g. equivalent width, dust luminosity, etc.). For this the physical property needs to be given in the input file and the properties to be fitted must be given in the properties filed in pcigale.ini. (Héctor Salas & Médéric Boquien)
- It is now possible to fit emission lines. For this the line has to be indicated in the same way as any other band both in the input flux file (in units of W/m²) and in the list of bands in `pcigale.ini`. Lines are prefixed with `line.` followed by the name of the line, for instance `line.H-alpha` for Hɑ. The following lines are supported at the moment: `Ly-alpha`, `CII-133.5`, `SiIV-139.7`, `CIV-154.9`, `HeII-164.0`, `OIII-166.5`, `CIII-190.9`, `CII-232.6`, `MgII-279.8`, `OII-372.7`, `H-10`, `H-9`, `NeIII-386.9` `HeI-388.9`, `H-epsilon`, `SII-407.0`, `H-delta`, `H-gamma`, `H-beta`, `OIII-495.9`, `OIII-500.7`, `OI-630.0`, `NII-654.8`, `H-alpha`, `NII-658.4`, `SII-671.6`, `SII-673.1`.
- It is now possible to fit emission lines. For this the line has to be indicated in the same way as any other band both in the input flux file (in units of W/m²) and in the list of bands in `pcigale.ini`. Lines are prefixed with `line.` followed by the name of the line, for instance `line.H-alpha` for Hɑ. The following lines are supported at the moment: `Ly-alpha`, `CII-133.5`, `SiIV-139.7`, `CIV-154.9`, `HeII-164.0`, `OIII-166.5`, `CIII-190.9`, `CII-232.6`, `MgII-279.8`, `OII-372.7`, `H-10`, `H-9`, `NeIII-386.9` `HeI-388.9`, `H-epsilon`, `SII-407.0`, `H-delta`, `H-gamma`, `H-beta`, `OIII-495.9`, `OIII-500.7`, `OI-630.0`, `NII-654.8`, `H-alpha`, `NII-658.4`, `SII-671.6`, `SII-673.1`. (Médéric Boquien)
- Two new dust attenuation modules have been added: `dustatt\_modified\_CF00` and `dustatt\_modified\_starburst`. The former implements a modified 2-component Charlot & Fall (2000) model whereas the latter implements a modified starburst law with the continuum attenuated with a Calzetti (2000) curve and the lines extincted with a Milky Way or a Magellanic Cloud law. The previous models `dustatt\_powerlaw`, `dustatt\_2powerlaws`, and `dustatt\_calzleit` are still available but are deprecated. (Médéric Boquien & David Corre)
### Changed
- The `sfhdelayed` module has been extended to optionally include an exponential burst to model the latest episode of star formation. (Médéric Boquien & Barbara Lo Faro)
......
# -*- coding: utf-8 -*-
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
"""
Modified Charlot & Fall 2000 dust attenuation module
===================================
This module implements an attenuation law combining the birth cloud (BC)
attenuation and the interstellar medium (ISM) attenuation, each one modelled by
a power law. The young star emission is attenuated by the BC and the ISM
attenuations whereas the old star emission is only affected by the ISM. This
simple model was proposed by Charlot & Fall (2000).
Parameters available for analysis
---------------------------------
- attenuation.Av_ISM: Av attenuation in the interstellar medium
- attenuation.mu: Av_ISM / (Av_BV+Av_ISM)
- attenuation.slope_BC: slope of the power law in the birth clouds
- attenuation.slope_ISM: slope of the power law in the ISM
- attenuation.<NAME>: amount of total attenuation in the luminosity
contribution <NAME>
- attenuation.<FILTER>: total attenuation in the filter
"""
from collections import OrderedDict
import numpy as np
from . import SedModule
def alambda_av(wl, delta):
"""Compute the complete attenuation curve A(λ)/Av
Attenuation curve of the form (λ / 550 nm) ** δ. The Lyman continuum is not
attenuated.
Parameters
----------
wl: array of floats
The wavelength grid in nm.
delta: float
Slope of the power law.
Returns
-------
attenuation: array of floats
The A(λ)/Av attenuation at each wavelength of the grid.
"""
attenuation = (wl / 550.) ** delta
# Lyman continuum not attenuated.
attenuation[wl <= 91.2] = 0.
return attenuation
class ModCF00Att(SedModule):
"""Two power laws attenuation module
Attenuation module combining the birth cloud (BC) attenuation and the
interstellar medium (ISM) one.
The attenuation can be computed on the whole spectrum or on a specific
contribution and is added to the SED as a negative contribution.
"""
parameter_list = OrderedDict([
("Av_ISM", (
"cigale_list(minvalue=0)",
"V-band attenuation in the interstellar medium.",
1.
)),
("mu", (
"cigale_list(minvalue=.0001, maxvalue=1.)",
"Av_ISM / (Av_BC+Av_ISM)",
0.44
)),
("slope_ISM", (
"cigale_list()",
"Power law slope of the attenuation in the ISM.",
-0.7
)),
("slope_BC", (
"cigale_list()",
"Power law slope of the attenuation in the birth clouds.",
-1.3
)),
("filters", (
"string()",
"Filters for which the attenuation will be computed and added to "
"the SED information dictionary. You can give several filter "
"names separated by a & (don't use commas).",
"V_B90 & FUV"
))
])
def _init_code(self):
self.Av_ISM = float(self.parameters['Av_ISM'])
self.mu = float(self.parameters['mu'])
self.slope_ISM = float(self.parameters['slope_ISM'])
self.slope_BC = float(self.parameters['slope_BC'])
self.filter_list = [item.strip() for item in
self.parameters["filters"].split("&")]
self.Av_BC = self.Av_ISM * (1. - self.mu) / self.mu
self.contatt = {}
self.lineatt = {}
def process(self, sed):
"""Add the dust attenuation to the SED.
Parameters
----------
sed: pcigale.sed.SED object
"""
wl = sed.wavelength_grid
# Compute the attenuation curves on the continuum wavelength grid
if len(self.contatt) == 0:
self.contatt['old'] = 10. ** (-.4 * alambda_av(wl, self.slope_ISM) *
self.Av_ISM)
# Emission from the young population is attenuated by both
# components
self.contatt['young'] = 10. ** (-.4 * alambda_av(wl, self.slope_BC) *
self.Av_BC) * self.contatt['old']
# Compute the attenuation curves on the line wavelength grid
if len(self.lineatt) == 0:
names = [k for k in sed.lines]
linewl = np.array([sed.lines[k][0] for k in names])
old_curve = 10. ** (-.4 * alambda_av(linewl, self.slope_ISM) *
self.Av_ISM)
young_curve = 10. ** (-.4 * alambda_av(linewl, self.slope_BC) *
self.Av_BC) * old_curve
for name, old, young in zip(names, old_curve, young_curve):
self.lineatt[name] = (old, young)
# Fλ fluxes in each filter before attenuation.
flux_noatt = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
dust_lumin = 0.
contribs = [contrib for contrib in sed.contribution_names if
'absorption' not in contrib]
for contrib in contribs:
age = contrib.split('.')[-1].split('_')[-1]
luminosity = sed.get_lumin_contribution(contrib)
attenuation_spectrum = luminosity * (self.contatt[age] - 1.)
dust_lumin -= np.trapz(attenuation_spectrum, wl)
sed.add_module(self.name, self.parameters)
sed.add_contribution("attenuation." + contrib, wl,
attenuation_spectrum)
for name, (linewl, old, young) in sed.lines.items():
sed.lines[name] = (linewl, old * self.lineatt[name][0],
young * self.lineatt[name][1])
sed.add_info('attenuation.Av_ISM', self.Av_ISM)
sed.add_info('attenuation.Av_BC', self.Av_BC)
sed.add_info('attenuation.mu', self.mu)
sed.add_info('attenuation.slope_BC', self.slope_BC)
sed.add_info('attenuation.slope_ISM', self.slope_ISM)
# Total attenuation
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"] + dust_lumin, True, True)
else:
sed.add_info("dust.luminosity", dust_lumin, True)
# Fλ fluxes (only in continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
# Attenuation in each filter
for filt in self.filter_list:
att = -2.5 * np.log10(flux_att[filt] / flux_noatt[filt])
sed.add_info("attenuation." + filt, max(0., att))
# CreationModule to be returned by get_module
Module = ModCF00Att
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Centre de données Astrophysiques de Marseille
# Copyright (C) 2014 Laboratoire d'Astrophysique de Marseille
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
# Author: Yannick Roehlly, Denis Burgarella
"""
Calzetti et al. (2000) and Leitherer et al. (2002) attenuation module
=====================================================================
This module implements the Calzetti et al. (2000) and Leitherer et al. (2002)
attenuation formulae, adding an UV-bump and a power law.
"""
from collections import OrderedDict
import numpy as np
from . import SedModule
def k_calzetti2000(wavelength):
"""Compute the Calzetti et al. (2000) A(λ)/E(B-V)∗
Given a wavelength grid, this function computes the selective attenuation
A(λ)/E(B-V)∗ using the formula from Calzetti at al. (2000). This formula
is given for wavelengths between 120 nm and 2200 nm, but this function
makes the computation outside.
Parameters
----------
wavelength: array of floats
Wavelength grid in nm.
Returns
-------
a numpy array of floats
"""
wavelength = np.array(wavelength)
result = np.zeros(len(wavelength))
# Attenuation between 120 nm and 630 nm
mask = (wavelength < 630)
result[mask] = 2.659 * (-2.156 + 1.509e3 / wavelength[mask] -
0.198e6 / wavelength[mask] ** 2 +
0.011e9 / wavelength[mask] ** 3) + 4.05
# Attenuation between 630 nm and 2200 nm
mask = (wavelength >= 630)
result[mask] = 2.659 * (-1.857 + 1.040e3 / wavelength[mask]) + 4.05
return result
def k_leitherer2002(wavelength):
"""Compute the Leitherer et al. (2002) A(λ)/E(B-V)∗
Given a wavelength grid, this function computes the selective attenuation
A(λ)/E(B-V)∗ using the formula from Leitherer at al. (2002). This formula
is given for wavelengths between 91.2 nm and 180 nm, but this function
makes the computation outside.
Parameters
----------
wavelength: array of floats
Wavelength grid in nm.
Returns
-------
a numpy array of floats
"""
wavelength = np.array(wavelength)
result = (5.472 + 0.671e3 / wavelength -
9.218e3 / wavelength ** 2 +
2.620e6 / wavelength ** 3)
return result
def uv_bump(wavelength, central_wave, gamma, ebump):
"""Compute the Lorentzian-like Drude profile.
Parameters
----------
wavelength: array of floats
Wavelength grid in nm.
central_wave: float
Central wavelength of the bump in nm.
gamma: float
Width (FWHM) of the bump in nm.
ebump: float
Amplitude of the bump.
Returns
-------
a numpy array of floats
"""
return (ebump * wavelength ** 2 * gamma ** 2 /
((wavelength ** 2 - central_wave ** 2) ** 2 +
wavelength ** 2 * gamma ** 2))
def power_law(wavelength, delta):
"""Power law 'centered' on 550 nm..
Parameters
----------
wavelength: array of floats
The wavelength grid in nm.
delta: float
The slope of the power law.
Returns
-------
array of floats
"""
return (wavelength / 550) ** delta
def a_vs_ebv(wavelength, bump_wave, bump_width, bump_ampl, power_slope):
"""Compute the complete attenuation curve A(λ)/E(B-V)*
The Leitherer et al. (2002) formula is used between 91.2 nm and 150 nm, and
the Calzetti et al. (2000) formula is used after 150 (we do an
extrapolation after 2200 nm). When the attenuation becomes negative, it is
kept to 0. This continuum is multiplied by the power law and then the UV
bump is added.
Parameters
----------
wavelength: array of floats
The wavelength grid (in nm) to compute the attenuation curve on.
bump_wave: float
Central wavelength (in nm) of the UV bump.
bump_width: float
Width (FWHM, in nm) of the UV bump.
bump_ampl: float
Amplitude of the UV bump.
power_slope: float
Slope of the power law.
Returns
-------
attenuation: array of floats
The A(λ)/E(B-V)* attenuation at each wavelength of the grid.
"""
attenuation = np.zeros(len(wavelength))
# Leitherer et al.
mask = (wavelength > 91.2) & (wavelength < 150)
attenuation[mask] = k_leitherer2002(wavelength[mask])
# Calzetti et al.
mask = (wavelength >= 150)
attenuation[mask] = k_calzetti2000(wavelength[mask])
# We set attenuation to 0 where it becomes negative
mask = (attenuation < 0)
attenuation[mask] = 0
# Power law
attenuation *= power_law(wavelength, power_slope)
# UV bump
attenuation += uv_bump(wavelength, bump_wave, bump_width, bump_ampl)
# As the powerlaw slope changes E(B-V), we correct this so that the curve
# always has the same E(B-V) as the starburst curve. This ensures that the
# E(B-V) requested by the user is the actual E(B-V) of the curve.
wl_BV = np.array([440., 550.])
EBV_calz = ((k_calzetti2000(wl_BV) * power_law(wl_BV, 0.)) +
uv_bump(wl_BV, bump_wave, bump_width, bump_ampl))
EBV = ((k_calzetti2000(wl_BV) * power_law(wl_BV, power_slope)) +
uv_bump(wl_BV, bump_wave, bump_width, bump_ampl))
attenuation *= (EBV_calz[1]-EBV_calz[0]) / (EBV[1]-EBV[0])
return attenuation
def ccm(wave, Rv):
""" Compute the complete attenuation curve A(λ)/E(B-V) for emission lines
Using Cardelli, Clayton & Mathis (1989) MW extinction function.
Valid from 1250 Angstroms to 3.3 microns.
Parameters
----------
wave : numpy.ndarray (1-d)
Wavelengths in nm.
Rv : float
Ratio of total to selective extinction, A_V / E(B-V).
"""
x = 1e3 / wave
# In the paper the condition is 0.3 < x < 1.1.
# However setting just x <1.1 avoids to have an artificial break at 0.3
# with something positive above 0.3 and 0 below.
cond1 = x < 1.1
cond2 = (x >= 1.1) & (x < 3.3)
cond3 = (x >= 3.3) & (x < 5.9)
cond4 = (x >= 5.9) & (x < 8.0)
cond5 = (x >= 8.0) & (x <= 11.)
fcond1 = lambda wn: Rv * .574 * wn**1.61 - .527 * wn**1.61
fcond2 = lambda wn: 1.0 * (Rv * np.polyval([-.505, 1.647, -0.827, -1.718,
1.137, .701, -0.609, 0.104, 1.],
wn - 1.82) +
np.polyval([3.347, -10.805, 5.491, 11.102,
-7.985, -3.989, 2.908, 1.952, 0.],
wn - 1.82))
fcond3 = lambda wn: 1.0 * (Rv * (1.752 - 0.316 * wn -
(0.104 / ((wn - 4.67)**2 + 0.341))) +
(-3.090 + 1.825 * wn +
(1.206 / ((wn - 4.62)**2 + 0.263))))
fcond4 = lambda wn: 1.0 * (Rv * (1.752 - 0.316 * wn -
(0.104 / ((wn - 4.67)**2 + 0.341)) +
np.polyval([-0.009779, -0.04473, 0., 0.],
wn - 5.9)) +
(-3.090 + 1.825 * wn +
(1.206 / ((wn - 4.62)**2 + 0.263)) +
np.polyval([0.1207, 0.2130, 0., 0.],
wn - 5.9)))
fcond5 = lambda wn: 1.0 * (Rv * (np.polyval([-0.070, 0.137, -0.628, -1.073],
wn-8.)) +
np.polyval([0.374, -0.420, 4.257, 13.670],
wn - 8.))
return np.piecewise(x, [cond1, cond2, cond3, cond4, cond5],
[fcond1, fcond2, fcond3, fcond4, fcond5])
def Pei92(wave, Rv=None, law='mw'):
""" Compute the extinction curve A(λ)/E(B-V) for emission lines
Using Pei92 (1989) MW,LMC,SMC extinction function.
Valid from 912 Angstroms to 25 microns.
Parameters
----------
wave : numpy.ndarray (1-d)
Wavelengths in nm.
Rv : float
Ratio of total to selective extinction, A_V / E(B-V).
law : string
name of the extinction curve to use: 'mw','lmc' or 'smc'
"""
wvl = wave * 1e-3
if law.lower() == 'smc':
if Rv is None:
Rv = 2.93
a_coeff = np.array([185, 27, 0.005, 0.010, 0.012, 0.03])
wvl_coeff = np.array([0.042, 0.08, 0.22, 9.7, 18, 25])
b_coeff = np.array([90, 5.50, -1.95, -1.95, -1.80, 0.0])
n_coeff = np.array([2.0, 4.0, 2.0, 2.0, 2.0, 2.0])
elif law.lower() == 'lmc':
if Rv is None:
Rv = 3.16
a_coeff = np.array([175, 19, 0.023, 0.005, 0.006, 0.02])
wvl_coeff = np.array([0.046, 0.08, 0.22, 9.7, 18, 25])
b_coeff = np.array([90, 5.5, -1.95, -1.95, -1.8, 0.0])
n_coeff = np.array([2.0, 4.5, 2.0, 2.0, 2.0, 2.0])
elif law.lower() == 'mw':
if Rv is None:
Rv = 3.08
a_coeff = np.array([165, 14, 0.045, 0.002, 0.002, 0.012])
wvl_coeff = np.array([0.046, 0.08, 0.22, 9.7, 18, 25])
b_coeff = np.array([90, 4.0, -1.95, -1.95, -1.8, 0.0])
n_coeff = np.array([2.0, 6.5, 2.0, 2.0, 2.0, 2.0])
Alambda_over_Ab = np.zeros(len(wvl))
for a, wv, b, n in zip(a_coeff, wvl_coeff, b_coeff, n_coeff):
Alambda_over_Ab += a / ((wvl / wv)**n + (wv / wvl)**n + b)
# Normalise with Av
Alambda_over_Av = (1 / Rv + 1) * Alambda_over_Ab
# set 0 for wvl < 91.2nm
Alambda_over_Av[wvl < 91.2 * 1e-3] = 0
# Set 0 for wvl > 30 microns
Alambda_over_Av[wvl > 30] = 0
# Transform Alambda_over_Av into Alambda_over_E(B-V)
Alambda_over_Ebv = Rv * Alambda_over_Av
return Alambda_over_Ebv
class ModStarburstAtt(SedModule):
"""Calzetti + Leitherer attenuation module
This module computes the dust attenuation using the
formulae from Calzetti et al. (2000) and Leitherer et al. (2002).
The attenuation can be computed on the whole spectrum or on a specific
contribution and is added to the SED as a negative contribution.
"""
parameter_list = OrderedDict([
("E_BV_lines", (
"cigale_list(minvalue=0.)",
"E(B-V)l, the colour excess of the nebular lines light for "
"both the young and old population.",
0.3
)),
("E_BV_factor", (
"cigale_list(minvalue=0., maxvalue=1.)",
"Reduction factor to apply on E_BV_lines to compute E(B-V)s "
"the stellar continuum attenuation. Both young and old population "
"are attenuated with E(B-V)s. ",
0.44
)),
("uv_bump_wavelength", (
"cigale_list(minvalue=0.)",
"Central wavelength of the UV bump in nm.",
217.5
)),
("uv_bump_width", (
"cigale_list()",
"Width (FWHM) of the UV bump in nm.",
35.
)),
("uv_bump_amplitude", (
"cigale_list(minvalue=0.)",
"Amplitude of the UV bump. For the Milky Way: 3.",
0.
)),
("powerlaw_slope", (
"cigale_list()",
"Slope delta of the power law modifying the attenuation curve.",
0.
)),
("Ext_law_emission_lines", (
"cigale_list(dtype=int, options=1 & 2 & 3)",
"Extinction law to use for attenuating the emissio n lines flux. "
"Possible values are: 1, 2, 3. 1: MW, 2: LMC, 3: SMC. MW is "
"modelled using CCM89, SMC and LMC using Pei92.",
1
)),
("Rv", (
"cigale_list()",
"Ratio of total to selective extinction, A_V / E(B-V), "
"for the extinction curve applied to emission lines."
"Standard value is 3.1 for MW using CCM89, but can be changed."
"For SMC and LMC using Pei92 the value is automatically set to "
"2.93 and 3.16 respectively, no matter the value you write.",
3.1
)),
("filters", (
"string()",
"Filters for which the attenuation will be computed and added to "
"the SED information dictionary. You can give several filter "
"names separated by a & (don't use commas).",
"B_B90 & V_B90 & FUV"
))
])
def _init_code(self):
"""Get the filters from the database"""
self.ebvl = float(self.parameters["E_BV_lines"])
self.ebv_factor = float(self.parameters["E_BV_factor"])
self.ebvs = self.ebv_factor * self.ebvl
self.uv_bump_wavelength = float(self.parameters["uv_bump_wavelength"])
self.uv_bump_width = float(self.parameters["uv_bump_width"])
self.uv_bump_amplitude = float(self.parameters["uv_bump_amplitude"])
self.powerlaw_slope = float(self.parameters["powerlaw_slope"])
self.ext_law_emLines = int(self.parameters["Ext_law_emission_lines"])
self.Rv = float(self.parameters["Rv"])
self.filter_list = [item.strip() for item in
self.parameters["filters"].split("&")]
# We cannot compute the attenuation until we know the wavelengths. Yet,
# we reserve the object.
self.contatt = None
self.lineatt = {}
def process(self, sed):
"""Add the modified Calzetti attenuation law to stellar continuum
for old and young stellar populations. Add the MW, LM or SMC extincton
curve to to the nebular lines and continuum for young and
stellar populations
Parameters
----------
sed: pcigale.sed.SED object
"""
wl = sed.wavelength_grid
# Fλ fluxes (only from continuum) in each filter before attenuation.
flux_noatt = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
# Compute stellar attenuation curve
if self.contatt is None:
self.contatt = 10 ** (-.4 * a_vs_ebv(wl, self.uv_bump_wavelength,
self.uv_bump_width,
self.uv_bump_amplitude,
self.powerlaw_slope) *
self.ebvs)
# Compute nebular attenuation curves
if len(self.lineatt) == 0:
names = [k for k in sed.lines]
linewl = np.array([sed.lines[k][0] for k in names])
if self.ext_law_emLines == 1:
self.lineatt['nebular'] = ccm(wl, self.Rv)
for name, att in zip(names, ccm(linewl, self.Rv)):
self.lineatt[name] = att
elif self.ext_law_emLines == 2:
self.lineatt['nebular'] = Pei92(wl, law='smc')
for name, att in zip(names, Pei92(linewl, law='smc')):
self.lineatt[name] = att
elif self.ext_law_emLines == 3:
self.lineatt['nebular'] = Pei92(wl, law='lmc')
for name, att in zip(names, Pei92(linewl, law='lmc')):
self.lineatt[name] = att
for k, v in self.lineatt.items():
self.lineatt[k] = 10. ** (-.4 * v * self.ebvl)
dust_lumin = 0.
contribs = [contrib for contrib in sed.contribution_names if
'absorption' not in contrib]
for contrib in contribs:
luminosity = sed.get_lumin_contribution(contrib)
if 'nebular' in contrib:
attenuation_spec = luminosity * (self.lineatt['nebular'] - 1.)
else:
attenuation_spec = luminosity * (self.contatt - 1.)
dust_lumin -= np.trapz(attenuation_spec, wl)
sed.add_module(self.name, self.parameters)
sed.add_contribution("attenuation." + contrib, wl,
attenuation_spec)
for name, (linewl, old, young) in sed.lines.items():
sed.lines[name] = (linewl, old * self.lineatt[name],
young * self.lineatt[name])
# Total attenuation
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"] + dust_lumin, True, True)
else:
sed.add_info("dust.luminosity", dust_lumin, True)
# Fλ fluxes (only from continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
# Attenuation in each filter
for filt in self.filter_list:
sed.add_info("attenuation." + filt,
-2.5 * np.log10(flux_att[filt] / flux_noatt[filt]))
sed.add_info('attenuation.E_BV_lines', self.ebvl)
sed.add_info('attenuation.E_BVs', self.ebvs)
sed.add_info('attenuation.E_BV_factor', self.ebv_factor)
sed.add_info('attenuation.uv_bump_wavelength', self.uv_bump_wavelength)
sed.add_info('attenuation.uv_bump_width', self.uv_bump_width)
sed.add_info('attenuation.uv_bump_amplitude', self.uv_bump_amplitude)
sed.add_info('attenuation.powerlaw_slope', self.powerlaw_slope)
# SedModule to be returned by get_module
Module = ModStarburstAtt
......@@ -274,7 +274,9 @@ class Configuration(object):
('nebular', ['nebular']),
('dust attenuation', ['dustatt_calzleit',
'dustatt_powerlaw',
'dustatt_2powerlaws']),
'dustatt_2powerlaws',
'dustatt_modified_CF00',
'dustatt_modified_starburst']),
('dust emission', ['casey2012', 'dale2014',
'dl2007', 'dl2014',
'themis']),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment