Commit f27ff5bb authored by BURGARELLA Denis's avatar BURGARELLA Denis
Browse files

Additional correction of a bug in the attenuation law

parent 97e690ca
# -*- 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
# Author: Yannick Roehlly, Denis Burgarella
"""
Calzetti et al. (2000) and Leitherer et al. (2002) attenuation module
......@@ -171,7 +172,7 @@ def a_vs_ebv(wavelength, bump_wave, bump_width, bump_ampl, power_slope):
class CalzLeit(CreationModule):
"""Calzetti + Leitherer attenuation module
This module computes the Cardelli, Clayton and Mathis attenuation using the
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
......
# -*- 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
# Author: Yannick Roehlly, Denis Burgarella
"""
Charlot and Fall (2000) power law attenuation module
......@@ -64,7 +65,7 @@ def uv_bump(wavelength, central_wave, gamma, ebump):
def alambda_av(wavelength, delta, bump_wave, bump_width, bump_ampl):
"""Compute the complete attenuation curve A(λ)/Av
The continuum is a power law (λ / λv) ** δ to with is added a UV bump.
The continuum is a power law (λ / λv) ** δ to which is added a UV bump.
Parameters
----------
......@@ -97,8 +98,8 @@ def alambda_av(wavelength, delta, bump_wave, bump_width, bump_ampl):
class PowerLawAtt(CreationModule):
"""Power law attenuation module
This module computes the Cardelli, Clayton and Mathis attenuation using
a power law as defined in Charlot and Fall (2000).
This module computes the attenuation using a power law
as defined in Charlot and Fall (2000).
The attenuation can be computed on the whole spectrum or on a specific
contribution and is added to the SED as a negative contribution.
......@@ -173,7 +174,7 @@ class PowerLawAtt(CreationModule):
self.sel_attenuation = None
def process(self, sed):
"""Add the CCM dust attenuation to the SED.
"""Add the dust attenuation to the SED.
Parameters
----------
......@@ -202,6 +203,7 @@ class PowerLawAtt(CreationModule):
self.sel_attenuation = alambda_av(wavelength, powerlaw_slope,
uv_bump_wavelength, uv_bump_width,
uv_bump_amplitude)
attenuation_total = 0.
for contrib in list(sed.contribution_names):
age = contrib.split('.')[-1].split('_')[-1]
......@@ -223,8 +225,8 @@ class PowerLawAtt(CreationModule):
attenuation_spectrum)
# Bump and slope of the dust attenuation
sed.add_info("attenuation.uv_bump_amplitude", uv_bump_amplitude, True)
sed.add_info("attenuation.powerlaw_slope", powerlaw_slope, True)
sed.add_info("attenuation.uv_bump_amplitude", uv_bump_amplitude)
sed.add_info("attenuation.powerlaw_slope", powerlaw_slope)
# Total attenuation
sed.add_info("dust.luminosity", attenuation_total, True)
......
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