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

Add the computation of the integrated stellar luminosity.

parent a620d5a0
......@@ -7,6 +7,7 @@
- Bands with negative fluxes are now considered valid and are fitted as any other band. (Médéric Boquien)
- Allow the models to be computed by blocks in `savefluxes`. This can be useful when computing a very large grid and/or to split the results file into various smaller files as large files can be difficult to handle. The number of blocks is set with the `blocks` parameters in the pcigale.ini. (Médéric Boquien)
- Allow the observations to be analysed by blocks of models in `pdf\_analysis`. This is useful when computing a very large grid of models that would not fit in memory. The number of blocks is set with the `blocks` parameters in the pcigale.ini. (Médéric Boquien)
- The integrated stellar luminosity is now provided as `stellar.lum`. (Médéric Boquien)
### Changed
- Make the timestamp more readable when moving the out/ directory. (Médéric Boquien)
......
......@@ -84,6 +84,9 @@ class BC03(SedModule):
lum_lyc_young, lum_lyc_old = np.trapz([spec_young[w], spec_old[w]],
wave[w])
# We do similarly for the total stellar luminosity
lum_young, lum_old = np.trapz([spec_young, spec_old], wave)
sed.add_module(self.name, self.parameters)
sed.add_info("stellar.imf", self.imf)
......@@ -94,16 +97,19 @@ class BC03(SedModule):
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_contribution("stellar.old", wave, spec_old)
......
......@@ -72,6 +72,8 @@ class M2005(SedModule):
"""
out = self.ssp.convolve(sed.sfh, self.separation_age)
spec_young, spec_old, info_young, info_old, info_all = out
lum_young, lum_old = np.trapz([spec_young, spec_old],
self.ssp.wavelength_grid)
sed.add_module(self.name, self.parameters)
......@@ -84,12 +86,14 @@ class M2005(SedModule):
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)
......@@ -97,6 +101,7 @@ class M2005(SedModule):
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_contribution("stellar.old", self.ssp.wavelength_grid, spec_old)
sed.add_contribution("stellar.young", self.ssp.wavelength_grid,
......
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