Commit c6b72a49 authored by Médéric Boquien's avatar Médéric Boquien

Add the units alongside the physical properties in the output FITS tables.

parent 1415d6f7
......@@ -9,6 +9,7 @@
- Saving the χ² is now a bit more fine-grained. It is possible to save none, all, only the properties, or only the fluxes. (Médéric Boquien)
- The database now includes the JWST MIRI and NIRCam filters. (Médéric Boquien)
- The SKIRTOR AGN models (Stalevski et al. 2016) have been implemented as the `skirtor2016` module. (Médéric Boquien, with the support of Marko Stalevski)
- The units are now given alongside the physical properties in the output FITS tables. (Médéric Boquien)
### Changed
- Python 3.6 is now the minimum required version. (Médéric Boquien)
- The `pcigale-plots` executable has been largely rewritten for better modularity and to enable the various improvements indicated below. (Rodrigo González Castillo & Médéric Boquien)
......
......@@ -12,6 +12,7 @@ of the models.
import ctypes
from astropy.table import Table, Column
from astropy.units import Unit
from .utils import SharedArray, get_info
......@@ -30,7 +31,7 @@ class ModelsManager(object):
self.params = params
self.block = params.blocks[iblock]
self.iblock = iblock
self.allpropnames, self.allextpropnames = get_info(self)
self.allpropnames, self.unit, self.allextpropnames = get_info(self)
self.allintpropnames = set(self.allpropnames) - self.allextpropnames
props_nolog = set([prop[:-4] if prop.endswith('log') else prop
......@@ -71,11 +72,13 @@ class ModelsManager(object):
else:
unit = 'mJy'
table.add_column(Column(self.flux[band], name=band,
unit=unit))
unit=Unit(unit)))
for prop in sorted(self.extprop.keys()):
table.add_column(Column(self.extprop[prop], name=prop))
table.add_column(Column(self.extprop[prop], name=prop,
unit=Unit(self.unit[prop])))
for prop in sorted(self.intprop.keys()):
table.add_column(Column(self.intprop[prop], name=prop))
table.add_column(Column(self.intprop[prop], name=prop,
unit=Unit(self.unit[prop])))
table.write(f"out/{filename}.fits")
table.write(f"out/{filename}.txt", format='ascii.fixed_width',
......
......@@ -40,7 +40,7 @@ class ObservationsManagerPassbands(object):
self.conf = config
self.params = params
self.allpropertiesnames, self.massproportional = get_info(self)
self.allpropertiesnames, _, self.massproportional = get_info(self)
self.table = read_table(config['data_file'])
self.bands = [band for band in config['bands']
if not band.endswith('_err')]
......
......@@ -13,6 +13,7 @@ results of the analysis with different blocks of models.
import ctypes
from astropy.table import Table, Column
from astropy.units import Unit
import numpy as np
from .utils import SharedArray
......@@ -339,6 +340,7 @@ class ResultsManager(object):
self.conf = models.conf
self.obs = models.obs
self.params = models.params
self.unit = models.unit
self.bayes = BayesResultsManager(models)
self.best = BestResultsManager(models)
......@@ -378,19 +380,24 @@ class ResultsManager(object):
for prop in sorted(self.bayes.intmean):
table.add_column(Column(self.bayes.intmean[prop],
name="bayes."+prop))
name="bayes."+prop,
unit=Unit(self.unit[prop])))
table.add_column(Column(self.bayes.interror[prop],
name="bayes."+prop+"_err"))
name="bayes."+prop+"_err",
unit=Unit(self.unit[prop])))
for prop in sorted(self.bayes.extmean):
table.add_column(Column(self.bayes.extmean[prop],
name="bayes."+prop))
name="bayes."+prop,
unit=Unit(self.unit[prop])))
table.add_column(Column(self.bayes.exterror[prop],
name="bayes."+prop+"_err"))
name="bayes."+prop+"_err",
unit=Unit(self.unit[prop])))
for band in sorted(self.bayes.fluxmean):
table.add_column(Column(self.bayes.fluxmean[band],
name="bayes."+band))
name="bayes."+band, unit=Unit('mJy')))
table.add_column(Column(self.bayes.fluxerror[band],
name="bayes."+band+"_err"))
name="bayes."+band+"_err",
unit=Unit('mJy')))
table.add_column(Column(self.best.chi2, name="best.chi_square"))
obs = [self.obs.table[obs].data for obs in self.obs.tofit]
......@@ -400,10 +407,12 @@ class ResultsManager(object):
for prop in sorted(self.best.intprop):
table.add_column(Column(self.best.intprop[prop],
name="best."+prop))
name="best."+prop,
unit=Unit(self.unit[prop])))
for prop in sorted(self.best.extprop):
table.add_column(Column(self.best.extprop[prop],
name="best."+prop))
name="best."+prop,
unit=Unit(self.unit[prop])))
for band in self.obs.bands:
if band.startswith('line.') or band.startswith('linefilter.'):
......
......@@ -21,7 +21,7 @@ def get_info(cls):
info = list(sed.info.keys())
info.sort()
return (info, sed.mass_proportional_info)
return (info, sed.unit, sed.mass_proportional_info)
class SharedArray(object):
......
......@@ -67,6 +67,7 @@ class SED(object):
self.lines = dict()
self.info = dict()
self.mass_proportional_info = set()
self.unit = dict()
@property
def sfh(self):
......@@ -88,12 +89,14 @@ class SED(object):
if value is not None:
sfh_sfr = value
self._sfh = value
self.add_info("sfh.sfr", sfh_sfr[-1], True, force=True)
self.add_info("sfh.sfr", sfh_sfr[-1], True, force=True,
unit='solMass/yr')
self.add_info("sfh.sfr10Myrs", np.mean(sfh_sfr[-10:]), True,
force=True)
force=True, unit='solMass/yr')
self.add_info("sfh.sfr100Myrs", np.mean(sfh_sfr[-100:]), True,
force=True)
self.add_info("sfh.age", sfh_sfr.size, False, force=True)
force=True, unit='solMass/yr')
self.add_info("sfh.age", sfh_sfr.size, False, force=True,
unit='Myr')
@property
def fnu(self):
......@@ -116,7 +119,8 @@ class SED(object):
return f_nu
def add_info(self, key, value, mass_proportional=False, force=False):
def add_info(self, key, value, mass_proportional=False, force=False,
unit=''):
"""
Add a key / value to the information dictionary
......@@ -141,6 +145,7 @@ class SED(object):
"""
if (key not in self.info) or force:
self.info[key] = value
self.unit[key] = unit
if mass_proportional:
self.mass_proportional_info.add(key)
else:
......@@ -386,6 +391,7 @@ class SED(object):
sed.contribution_names = self.contribution_names[:]
sed.lines = self.lines.copy()
sed.info = self.info.copy()
sed.unit = self.unit # No need to copy, the units will not change
sed.mass_proportional_info = self.mass_proportional_info.copy()
return sed
......@@ -91,26 +91,32 @@ class BC03(SedModule):
sed.add_info("stellar.imf", self.imf)
sed.add_info("stellar.metallicity", self.metallicity)
sed.add_info("stellar.old_young_separation_age", self.separation_age)
sed.add_info("stellar.m_star_young", info_young["m_star"], True)
sed.add_info("stellar.m_gas_young", info_young["m_gas"], True)
sed.add_info("stellar.n_ly_young", info_young["n_ly"], True)
sed.add_info("stellar.lum_ly_young", lum_lyc_young, True)
sed.add_info("stellar.lum_young", lum_young, True)
sed.add_info("stellar.m_star_old", info_old["m_star"], True)
sed.add_info("stellar.m_gas_old", info_old["m_gas"], True)
sed.add_info("stellar.n_ly_old", info_old["n_ly"], True)
sed.add_info("stellar.lum_ly_old", lum_lyc_old, True)
sed.add_info("stellar.lum_old", lum_old, True)
sed.add_info("stellar.m_star", info_all["m_star"], True)
sed.add_info("stellar.m_gas", info_all["m_gas"], True)
sed.add_info("stellar.n_ly", info_all["n_ly"], True)
sed.add_info("stellar.lum_ly", lum_lyc_young + lum_lyc_old, True)
sed.add_info("stellar.lum", lum_young + lum_old, True)
sed.add_info("stellar.age_m_star", info_all["age_mass"])
sed.add_info("stellar.old_young_separation_age", self.separation_age,
unit='Myr')
sed.add_info("stellar.m_star_young", info_young["m_star"], True,
unit='solMass')
sed.add_info("stellar.m_gas_young", info_young["m_gas"], True,
unit='solMass')
sed.add_info("stellar.n_ly_young", info_young["n_ly"], True,
unit='ph/s')
sed.add_info("stellar.lum_ly_young", lum_lyc_young, True, unit='W')
sed.add_info("stellar.lum_young", lum_young, True, unit='W')
sed.add_info("stellar.m_star_old", info_old["m_star"], True,
unit='solMass')
sed.add_info("stellar.m_gas_old", info_old["m_gas"], True,
unit='solMass')
sed.add_info("stellar.n_ly_old", info_old["n_ly"], True, unit='ph/s')
sed.add_info("stellar.lum_ly_old", lum_lyc_old, True, unit='W')
sed.add_info("stellar.lum_old", lum_old, True, unit='W')
sed.add_info("stellar.m_star", info_all["m_star"], True, unit='solMass')
sed.add_info("stellar.m_gas", info_all["m_gas"], True, unit='solMass')
sed.add_info("stellar.n_ly", info_all["n_ly"], True, unit='ph/s')
sed.add_info("stellar.lum_ly", lum_lyc_young + lum_lyc_old, True, unit='W')
sed.add_info("stellar.lum", lum_young + lum_old, True, unit='W')
sed.add_info("stellar.age_m_star", info_all["age_mass"], unit='Myr')
sed.add_contribution("stellar.old", wave, spec_old)
sed.add_contribution("stellar.young", wave, spec_young)
......
......@@ -97,11 +97,11 @@ class Casey2012(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
sed.add_module(self.name, self.parameters)
sed.add_info("dust.temperature", self.temperature)
sed.add_info("dust.temperature", self.temperature, unit='K')
sed.add_info("dust.beta", self.beta)
sed.add_info("dust.alpha", self.alpha)
......
......@@ -86,7 +86,7 @@ class Dale2014(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
if self.fracAGN < 1.:
......
......@@ -108,7 +108,7 @@ class DL2007(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
sed.add_module(self.name, self.parameters)
......@@ -119,7 +119,8 @@ class DL2007(SedModule):
sed.add_info('dust.gamma', self.gamma)
# To compute the dust mass we simply divide the luminosity in W by the
# emissivity in W/kg of dust.
sed.add_info('dust.mass', luminosity / self.emissivity, True)
sed.add_info('dust.mass', luminosity / self.emissivity, True,
unit='solMass')
sed.add_contribution('dust.Umin_Umin', self.model_minmin.wave,
luminosity * self.model_minmin.lumin)
......
......@@ -128,7 +128,7 @@ class DL2014(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
sed.add_module(self.name, self.parameters)
......@@ -139,7 +139,8 @@ class DL2014(SedModule):
sed.add_info('dust.gamma', self.gamma)
# To compute the dust mass we simply divide the luminosity in W by the
# emissivity in W/kg of dust.
sed.add_info('dust.mass', luminosity / self.emissivity, True)
sed.add_info('dust.mass', luminosity / self.emissivity, True,
unit='solMass')
sed.add_contribution('dust.Umin_Umin', self.model_minmin.wave,
luminosity * self.model_minmin.lumin)
......
......@@ -201,17 +201,18 @@ class TwoPowerLawAtt(SedModule):
sed.lines[name] = (linewl, old * self.lineatt[name][0],
young * self.lineatt[name][1])
sed.add_info('attenuation.Av_BC', self.Av_BC)
sed.add_info('attenuation.slope_BC', self.slope_BC)
sed.add_info('attenuation.Av_BC', self.Av_BC, unit='mag')
sed.add_info('attenuation.slope_BC', self.slope_BC, unit='mag')
sed.add_info('attenuation.BC_to_ISM_factor', self.BC_to_ISM_factor)
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)
sed.info["dust.luminosity"] + dust_lumin, True, True,
unit='W')
else:
sed.add_info("dust.luminosity", dust_lumin, True)
sed.add_info("dust.luminosity", dust_lumin, True, unit='W')
# Fλ fluxes (only in continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
......@@ -219,7 +220,8 @@ class TwoPowerLawAtt(SedModule):
# 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]))
-2.5 * np.log10(flux_att[filt] / flux_noatt[filt]),
unit='mag')
# CreationModule to be returned by get_module
......
......@@ -304,8 +304,10 @@ class CalzLeit(SedModule):
attenuation_total += attenuation
sed.add_module(self.name, self.parameters)
sed.add_info("attenuation.E_BVs." + contrib, self.ebvs[age])
sed.add_info("attenuation." + contrib, attenuation, True)
sed.add_info("attenuation.E_BVs." + contrib, self.ebvs[age],
unit='mag')
sed.add_info("attenuation." + contrib, attenuation, True,
unit='mag')
sed.add_contribution("attenuation." + contrib, wavelength,
attenuation_spectrum)
......@@ -317,9 +319,9 @@ class CalzLeit(SedModule):
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"]+attenuation_total, True,
True)
True, unit=W)
else:
sed.add_info("dust.luminosity", attenuation_total, True)
sed.add_info("dust.luminosity", attenuation_total, True, unit='W')
# Fλ fluxes (only from continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
......@@ -327,11 +329,13 @@ class CalzLeit(SedModule):
# 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]))
-2.5 * np.log10(flux_att[filt] / flux_noatt[filt]),
unit='mag')
sed.add_info('attenuation.ebvs_old_factor', self.ebvs_old_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_wavelength', self.uv_bump_wavelength,
unit='nm')
sed.add_info('attenuation.uv_bump_width', self.uv_bump_width, unit='nm')
sed.add_info('attenuation.uv_bump_amplitude', self.uv_bump_amplitude)
sed.add_info('attenuation.powerlaw_slope', self.powerlaw_slope)
......
......@@ -166,8 +166,8 @@ class ModCF00Att(SedModule):
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.Av_ISM', self.Av_ISM, unit='mag')
sed.add_info('attenuation.Av_BC', self.Av_BC, unit='mag')
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)
......@@ -175,9 +175,10 @@ class ModCF00Att(SedModule):
# Total attenuation
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"] + dust_lumin, True, True)
sed.info["dust.luminosity"] + dust_lumin, True, True,
unit='W')
else:
sed.add_info("dust.luminosity", dust_lumin, True)
sed.add_info("dust.luminosity", dust_lumin, True, unit='W')
# Fλ fluxes (only in continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
......@@ -185,7 +186,7 @@ class ModCF00Att(SedModule):
# 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))
sed.add_info("attenuation." + filt, max(0., att), unit='mag')
# CreationModule to be returned by get_module
......
......@@ -445,9 +445,10 @@ class ModStarburstAtt(SedModule):
# Total attenuation
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"] + dust_lumin, True, True)
sed.info["dust.luminosity"] + dust_lumin, True, True,
unit='W')
else:
sed.add_info("dust.luminosity", dust_lumin, True)
sed.add_info("dust.luminosity", dust_lumin, True, unit='W')
# Fλ fluxes (only from continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
......@@ -455,13 +456,15 @@ class ModStarburstAtt(SedModule):
# 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]))
-2.5 * np.log10(flux_att[filt] / flux_noatt[filt]),
unit='mag')
sed.add_info('attenuation.E_BV_lines', self.ebvl)
sed.add_info('attenuation.E_BVs', self.ebvs)
sed.add_info('attenuation.E_BV_lines', self.ebvl, unit='mag')
sed.add_info('attenuation.E_BVs', self.ebvs, unit='mag')
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_wavelength', self.uv_bump_wavelength,
unit='nm')
sed.add_info('attenuation.uv_bump_width', self.uv_bump_width, unit='nm')
sed.add_info('attenuation.uv_bump_amplitude', self.uv_bump_amplitude)
sed.add_info('attenuation.powerlaw_slope', self.powerlaw_slope)
......
......@@ -213,7 +213,7 @@ class PowerLawAtt(SedModule):
dust_lumin -= np.trapz(attenuation_spectrum, wavelength)
sed.add_module(self.name, self.parameters)
sed.add_info("attenuation.Av." + contrib, self.av[age])
sed.add_info("attenuation.Av." + contrib, self.av[age], unit='mag')
sed.add_contribution("attenuation." + contrib, wavelength,
attenuation_spectrum)
......@@ -222,17 +222,19 @@ class PowerLawAtt(SedModule):
young * self.lineatt[name][1])
sed.add_info("attenuation.av_old_factor", self.av_old_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_wavelength', self.uv_bump_wavelength,
unit='nm')
sed.add_info('attenuation.uv_bump_width', self.uv_bump_width, unit='nm')
sed.add_info("attenuation.uv_bump_amplitude", self.uv_bump_amplitude)
sed.add_info("attenuation.powerlaw_slope", self.powerlaw_slope)
# Total attenuation
if 'dust.luminosity' in sed.info:
sed.add_info("dust.luminosity",
sed.info["dust.luminosity"] + dust_lumin, True, True)
sed.info["dust.luminosity"] + dust_lumin, True, True,
unit='W')
else:
sed.add_info("dust.luminosity", dust_lumin, True)
sed.add_info("dust.luminosity", dust_lumin, True, unit='W')
# Fλ fluxes (only in continuum) in each filter after attenuation.
flux_att = {filt: sed.compute_fnu(filt) for filt in self.filter_list}
......@@ -240,7 +242,8 @@ class PowerLawAtt(SedModule):
# 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]))
-2.5 * np.log10(flux_att[filt] / flux_noatt[filt]),
unit='mag')
# SedModule to be returned by get_module
......
......@@ -116,7 +116,7 @@ class Fritz2006(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
sed.add_module(self.name, self.parameters)
......@@ -124,8 +124,9 @@ class Fritz2006(SedModule):
sed.add_info('agn.tau', self.tau)
sed.add_info('agn.beta', self.beta)
sed.add_info('agn.gamma', self.gamma)
sed.add_info('agn.opening_angle', self.parameters["opening_angle"])
sed.add_info('agn.psy', self.psy)
sed.add_info('agn.opening_angle', self.parameters["opening_angle"],
unit='deg')
sed.add_info('agn.psy', self.psy, unit='deg')
sed.add_info('agn.fracAGN', self.fracAGN)
# Compute the AGN luminosity
......@@ -140,10 +141,10 @@ class Fritz2006(SedModule):
raise Exception("AGN fraction is exactly 1. Behaviour "
"undefined.")
sed.add_info('agn.therm_luminosity', l_agn_therm, True)
sed.add_info('agn.scatt_luminosity', l_agn_scatt, True)
sed.add_info('agn.agn_luminosity', l_agn_agn, True)
sed.add_info('agn.luminosity', l_agn_total, True)
sed.add_info('agn.therm_luminosity', l_agn_therm, True, unit='W')
sed.add_info('agn.scatt_luminosity', l_agn_scatt, True, unit='W')
sed.add_info('agn.agn_luminosity', l_agn_agn, True, unit='W')
sed.add_info('agn.luminosity', l_agn_total, True, unit='W')
sed.add_contribution('agn.fritz2006_therm', self.fritz2006.wave,
agn_power * self.fritz2006.lumin_therm)
......
......@@ -81,29 +81,42 @@ class M2005(SedModule):
sed.add_info('stellar.imf', self.imf)
sed.add_info('stellar.metallicity', self.metallicity)
sed.add_info('stellar.old_young_separation_age', self.separation_age)
sed.add_info('stellar.mass_total_young', info_young[0], True)
sed.add_info('stellar.mass_alive_young', info_young[1], True)
sed.add_info('stellar.mass_white_dwarf_young', info_young[2], True)
sed.add_info('stellar.mass_neutron_young', info_young[3], True)
sed.add_info('stellar.mass_black_hole_young', info_young[4], True)
sed.add_info('stellar.lum_young', lum_young, True)
sed.add_info('stellar.mass_total_old', info_old[0], True)
sed.add_info('stellar.mass_alive_old', info_old[1], True)
sed.add_info('stellar.mass_white_dwarf_old', info_old[2], True)
sed.add_info('stellar.mass_neutron_old', info_old[3], True)
sed.add_info('stellar.mass_black_hole_old', info_old[4], True)
sed.add_info('stellar.lum_old', lum_old, True)
sed.add_info('stellar.mass_total', info_all[0], True)
sed.add_info('stellar.mass_alive', info_all[1], True)
sed.add_info('stellar.mass_white_dwarf', info_all[2], True)
sed.add_info('stellar.mass_neutron', info_all[3], True)
sed.add_info('stellar.mass_black_hole', info_all[4], True)
sed.add_info('stellar.age_mass', info_all[5])
sed.add_info('stellar.lum', lum_young + lum_old, True)
sed.add_info('stellar.old_young_separation_age', self.separation_age,
unit='Myr')
sed.add_info('stellar.mass_total_young', info_young[0], True,
unit='solMass')
sed.add_info('stellar.mass_alive_young', info_young[1], True,
unit='solMass')
sed.add_info('stellar.mass_white_dwarf_young', info_young[2], True,
unit='solMass')
sed.add_info('stellar.mass_neutron_young', info_young[3], True,
unit='solMass')
sed.add_info('stellar.mass_black_hole_young', info_young[4], True,
unit='solMass')
sed.add_info('stellar.lum_young', lum_young, True, unit='W')
sed.add_info('stellar.mass_total_old', info_old[0], True,
unit='solMass')
sed.add_info('stellar.mass_alive_old', info_old[1], True,
unit='solMass')
sed.add_info('stellar.mass_white_dwarf_old', info_old[2], True,
unit='solMass')
sed.add_info('stellar.mass_neutron_old', info_old[3], True,
unit='solMass')
sed.add_info('stellar.mass_black_hole_old', info_old[4], True,
unit='solMass')
sed.add_info('stellar.lum_old', lum_old, True, unit='W')
sed.add_info('stellar.mass_total', info_all[0], True, unit='solMass')
sed.add_info('stellar.mass_alive', info_all[1], True, unit='solMass')
sed.add_info('stellar.mass_white_dwarf', info_all[2], True,
unit='solMass')
sed.add_info('stellar.mass_neutron', info_all[3], True, unit='solMass')
sed.add_info('stellar.mass_black_hole', info_all[4], True,
unit='solMass')
sed.add_info('stellar.age_mass', info_all[5], unit='Myr')
sed.add_info('stellar.lum', lum_young + lum_old, True, unit='W')
sed.add_contribution("stellar.old", self.ssp.wavelength_grid, spec_old)
sed.add_contribution("stellar.young", self.ssp.wavelength_grid,
......
......@@ -98,11 +98,11 @@ class MBB(SedModule):
"""
if 'dust.luminosity' not in sed.info:
sed.add_info('dust.luminosity', 1., True)
sed.add_info('dust.luminosity', 1., True, unit='W')
luminosity = sed.info['dust.luminosity']
sed.add_module(self.name, self.parameters)
sed.add_info("dust.t_mbb", self.T)
sed.add_info("dust.t_mbb", self.T, unit='K')
sed.add_info("dust.beta_mbb", self.beta)
sed.add_info("dust.epsilon_mbb", self.epsilon)
......
......@@ -179,7 +179,8 @@ class NebularEmission(SedModule):
sed.add_info('nebular.f_esc', self.fesc)
sed.add_info('nebular.f_dust', self.fdust)
sed.add_info('dust.luminosity', (sed.info['stellar.lum_ly_young'] +