From 8942e2e0611d1491b304bc60f397b96942ca79c7 Mon Sep 17 00:00:00 2001 From: Yannick Roehlly Date: Tue, 1 Dec 2015 17:54:53 +0100 Subject: [PATCH] Homogenise attenuation modules outputs In the attenuation modules, remove the attenuation.ebvs_main and attenuation.ebvs_young parameter that are duplicates of attenuation.E_BVs.stellar.old and attenuation.E_BVs.stellar.young. Homogenise the outputs of the two modules and add the Av/E_BVs old factors to the information dictionary so that their analysis can be done. --- CHANGELOG.md | 3 +++ pcigale/creation_modules/dustatt_calzleit.py | 6 +++--- pcigale/creation_modules/dustatt_powerlaw.py | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19805354..ce354049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ - When no dust emission module is used, pcigale genconf complains that no dust attenuation module is used. Correctly specify dust emission and not attenuation. (Médéric Boquien and Laure Ciesla) - Allowing more flexibility to read ASCII files broke the handling of FITS files. It is now fixed. (Yannick Roehlly) +### Changed +- The attenuation.ebvs\_main and attenuation.ebvs\_old parameters are no longer present as they were duplicates of attenuation.E\_BVs.stellar.old and attenuation.E\_BVs.stellar.young (that are still available). + ## 0.7.0 (2015-11-19) ### Added - The pcigale-mock utility has been added to generate plots comparing the exact and pcigale-estimated parameters. This requires pcigale to be run beforehand with the pdf_analysis module and the mock_flag option set to True. (Denis Burgarella and Médéric Boquien) diff --git a/pcigale/creation_modules/dustatt_calzleit.py b/pcigale/creation_modules/dustatt_calzleit.py index 325fb924..25efcc8f 100644 --- a/pcigale/creation_modules/dustatt_calzleit.py +++ b/pcigale/creation_modules/dustatt_calzleit.py @@ -243,7 +243,8 @@ class CalzLeit(CreationModule): ebvs = {} wavelength = sed.wavelength_grid ebvs['young'] = float(self.parameters["E_BVs_young"]) - ebvs['old'] = float(self.parameters["E_BVs_old_factor"]) * ebvs['young'] + ebvs_old_factor = float(self.parameters["E_BVs_old_factor"]) + ebvs['old'] = ebvs_old_factor * ebvs['young'] uv_bump_wavelength = float(self.parameters["uv_bump_wavelength"]) uv_bump_width = float(self.parameters["uv_bump_width"]) uv_bump_amplitude = float(self.parameters["uv_bump_amplitude"]) @@ -294,8 +295,7 @@ class CalzLeit(CreationModule): sed.add_info("attenuation." + filt, -2.5 * np.log10(flux_att[filt] / flux_noatt[filt])) - sed.add_info('attenuation.ebvs_main', ebvs['old']) - sed.add_info('attenuation.ebvs_young', ebvs['young']) + sed.add_info('attenuation.ebvs_old_factor', ebvs_old_factor) sed.add_info('attenuation.uv_bump_wavelength', uv_bump_wavelength) sed.add_info('attenuation.uv_bump_width', uv_bump_width) sed.add_info('attenuation.uv_bump_amplitude', uv_bump_amplitude) diff --git a/pcigale/creation_modules/dustatt_powerlaw.py b/pcigale/creation_modules/dustatt_powerlaw.py index ab053e0a..0736f3be 100644 --- a/pcigale/creation_modules/dustatt_powerlaw.py +++ b/pcigale/creation_modules/dustatt_powerlaw.py @@ -169,7 +169,8 @@ class PowerLawAtt(CreationModule): av = {} wavelength = sed.wavelength_grid av['young'] = float(self.parameters["Av_young"]) - av['old'] = float(self.parameters["Av_old_factor"] * av['young']) + av_old_factor = float(self.parameters["Av_old_factor"]) + av['old'] = av_old_factor * av['young'] uv_bump_wavelength = float(self.parameters["uv_bump_wavelength"]) uv_bump_width = float(self.parameters["uv_bump_width"]) uv_bump_amplitude = float(self.parameters["uv_bump_amplitude"]) @@ -204,7 +205,9 @@ class PowerLawAtt(CreationModule): sed.add_contribution("attenuation." + contrib, wavelength, attenuation_spectrum) - # Bump and slope of the dust attenuation + sed.add_info("attenuation.av_old_factor", av_old_factor) + sed.add_info('attenuation.uv_bump_wavelength', uv_bump_wavelength) + sed.add_info('attenuation.uv_bump_width', uv_bump_width) sed.add_info("attenuation.uv_bump_amplitude", uv_bump_amplitude) sed.add_info("attenuation.powerlaw_slope", powerlaw_slope) -- GitLab