Commit 7dafb6cf authored by Médéric Boquien's avatar Médéric Boquien

Merge branch 'develop' into lambda_AGN

parents 3a9a0e00 026c8b6b
Pipeline #3671 skipped with stage
......@@ -14,6 +14,8 @@
- The help of `pcigale-plots sed` incorrectly reported that the values given to the `--xrange` option were in nm, rather than μm. (Médéric Boquien, reported by Guang Yang)
- A run with an already existing `out/` directory led to a crash under Microsoft Windows. This was due to renaming `out/` to add the time with hours, minutes, and second separated by a colon. This is not allowed on this platform. The renamed directory has not been made compact and does not use colons anymore. (Médéric Boquien, reported by Samir Salim)
- The units of line fluxes were not always correct for Bayesian estimates. (Médéric Boquien, reported by Katarzyna Małek)
- An input redshift of integer type caused `pcigale-plots sed` to crash because it could not be formatted as a float. It is now explicitly converted to a float for safety. (Médéric Boquien)
- SED plots could not be generated for runs without a dust attenuation module as `pcigale-plots sed` assumed there would be one. This case is now handled. (Médéric Boquien)
### Optimised
- The estimation of the physical properties and the related uncertainties has been made up to 50% faster. The final gain in the analysis speed accounting for all the steps depends on the number of properties to be evaluated and the number of models but can be over 25% when estimating many properties over a large parameter space. (Médéric Boquien)
- Invalid models (e.g., when the stellar populations are older than the universe) are now ignored when handling upper limits. The speedup is very variable but can be substantial in case there are many invalid models. (Médéric Boquien)
......
......@@ -127,9 +127,9 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
if "best."+filt in mod.colnames else np.nan
for filt in filters.keys()])
if obs['redshift'] >= 0:
z = obs['redshift']
z = float(obs['redshift'])
else: # Redshift mode
z = mod['best.universe.redshift']
z = float(mod['best.universe.redshift'])
zp1 = 1. + z
surf = 4. * np.pi * mod['best.universe.luminosity_distance'] ** 2
......@@ -168,26 +168,21 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
# Stellar emission
if ('stellar_attenuated' in series
and 'stellar.young' in sed.columns):
if 'nebular.absorption_young' in sed.columns:
ax1.loglog(wavelength_spec[wsed],
(sed['stellar.young'][wsed] +
sed['attenuation.stellar.young'][wsed] +
sed['nebular.absorption_young'][wsed] +
sed['stellar.old'][wsed] +
sed['attenuation.stellar.old'][wsed] +
sed['nebular.absorption_old'][wsed]),
label="Stellar attenuated", color='gold',
marker=None, nonposy='clip', linestyle='-',
linewidth=1.0)
else:
ax1.loglog(wavelength_spec[wsed],
(sed['stellar.young'][wsed] +
sed['attenuation.stellar.young'][wsed] +
sed['stellar.old'][wsed] +
sed['attenuation.stellar.old'][wsed]),
label="Stellar attenuated", color='gold',
marker=None, nonposy='clip', linestyle='-',
linewidth=1.0)
spectrum = (sed['stellar.young'][wsed] +
sed['stellar.old'][wsed])
if 'nebular.absoroption_young' in sed.columns:
spectrum += sed['nebular.absortion_young'][wsed]
spectrum += sed['nebular.absorption_old'][wsed]
if 'attenuation.stellar.young' in sed.columns:
spectrum += sed['attenuation.stellar.young'][wsed]
spectrum += sed['attenuation.stellar.old'][wsed]
ax1.loglog(wavelength_spec[wsed], spectrum,
label="Stellar attenuated", color='gold',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
if ('stellar_unattenuated' in series
and 'stellar.young' in sed.columns):
......@@ -196,21 +191,24 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
sed['stellar.young'][wsed]),
label="Stellar unattenuated",
color='xkcd:deep sky blue', marker=None,
nonposy='clip', linestyle='--', linewidth=1.0)
nonpositive='clip', linestyle='--', linewidth=1.0)
# Nebular emission
if 'nebular' in series and 'nebular.lines_young' in sed.columns:
ax1.loglog(wavelength_spec[wsed],
(sed['nebular.lines_young'][wsed] +
spectrum = (sed['nebular.lines_young'][wsed] +
sed['nebular.lines_old'][wsed] +
sed['nebular.continuum_young'][wsed] +
sed['nebular.continuum_old'][wsed] +
sed['attenuation.nebular.lines_young'][wsed] +
sed['attenuation.nebular.lines_old'][wsed] +
sed['attenuation.nebular.continuum_young'][wsed] +
sed['attenuation.nebular.continuum_old'][wsed]),
sed['nebular.continuum_old'][wsed])
if 'attenuation.nebular.lines_young' in sed.columns:
spectrum += sed['attenuation.nebular.lines_young'][wsed]
spectrum += sed['attenuation.nebular.lines_old'][wsed]
spectrum += sed['attenuation.nebular.continuum_young'][wsed]
spectrum += sed['attenuation.nebular.continuum_old'][wsed]
ax1.loglog(wavelength_spec[wsed], spectrum,
label="Nebular emission", color='xkcd:true green',
marker=None, nonposy='clip', linewidth=1.0)
marker=None, nonpositive='clip', linewidth=1.0)
# Dust emission Draine & Li
if 'dust' in series and 'dust.Umin_Umin' in sed.columns:
......@@ -218,14 +216,14 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
(sed['dust.Umin_Umin'][wsed] +
sed['dust.Umin_Umax'][wsed]),
label="Dust emission", color='xkcd:bright red',
marker=None, nonposy='clip', linestyle='-',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
# Dust emission Dale
if 'dust' in series and 'dust' in sed.columns:
ax1.loglog(wavelength_spec[wsed], sed['dust'][wsed],
label="Dust emission", color='xkcd:bright red',
marker=None, nonposy='clip', linestyle='-',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
# AGN emission Fritz
......@@ -235,7 +233,7 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
sed['agn.fritz2006_scatt'][wsed] +
sed['agn.fritz2006_agn'][wsed]),
label="AGN emission", color='xkcd:apricot',
marker=None, nonposy='clip', linestyle='-',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
# AGN emission SKIRTOR
......@@ -244,7 +242,7 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
(sed['agn.SKIRTOR2016_dust'][wsed] +
sed['agn.SKIRTOR2016_disk'][wsed]),
label="AGN emission", color='xkcd:apricot',
marker=None, nonposy='clip', linestyle='-',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
# Radio emission
......@@ -252,13 +250,13 @@ def _sed_worker(obs, mod, filters, sed_type, logo, xrange, yrange, series,
ax1.loglog(wavelength_spec[wsed],
sed['radio_nonthermal'][wsed],
label="Radio nonthermal", color='brown',
marker=None, nonposy='clip', linestyle='-',
marker=None, nonpositive='clip', linestyle='-',
linewidth=1.0)
if 'model' in series:
ax1.loglog(wavelength_spec[wsed], sed['L_lambda_total'][wsed],
label="Model spectrum", color='k', nonposy='clip',
linestyle='-', linewidth=1.5)
label="Model spectrum", color='k',
nonpositive='clip', linestyle='-', linewidth=1.5)
ax1.set_autoscale_on(False)
s = np.argsort(filters_wl)
......
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