Commit d44a99c7 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Compute the best fit at the at the exact distance of the analysed object and...

Compute the best fit at the at the exact distance of the analysed object and not at the distance of the rounded redshift. This eliminates the need for a correction factor.
parent fb870383
......@@ -17,6 +17,7 @@
- Corrected a typo that prevented `restframe\_parameters` from being listed among the available modules. (Médéric Boquien)
- The filters in the residual plot of `pcigale-plots sed` are now drawn in order of increasing wavelength so that the line joining all the filters does not make loops. (Médéric Boquien)
- In the absence of a nebular component `restframe\_parameters` would crash when attempting to compute the equivalent widths of the lines listed in `EW_lines`. Now they are simply ignored. (Médéric Boquien)
- The luminosity spectrum of the best fit was saved assuming the distance corresponding to the redshift rounded to two decimals. This was an issue in particular at very low redshift as a difference of 0.005 in redshift can translate to a large difference on the luminosity distance. Now the exact luminosity distance of the object is used to compute the spectrum luminosity. (Médéric Boquien, reported by Jorge Melnick)
### Optimised
- The cache architecture has been simplified, making it somewhat faster. It speeds up the model generation by ~1%. (Médéric Boquien)
......@@ -6,6 +6,7 @@
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
# Author: Yannick Roehlly, Médéric Boquien & Denis Burgarella
from copy import deepcopy
import time
import numpy as np
......@@ -236,8 +237,12 @@ def bestfit(oidx, obs):
gbl_params.index_module_changed(gbl_previous_idx, best_index))
gbl_previous_idx = best_index
sed = gbl_warehouse.get_sed(gbl_params.modules,
# We compute the model at the exact redshift not to have to correct for the
# difference between the object and the grid redshifts.
params = deepcopy(gbl_params.from_index(best_index))
params[-1]['redshift'] = obs['redshift']
sed = gbl_warehouse.get_sed(gbl_params.modules, params)
fluxes = np.array([sed.compute_fnu(filt) for filt in gbl_obs.bands])
obs_fluxes = np.array([obs[name] for name in gbl_obs.bands])
......@@ -249,8 +254,7 @@ def bestfit(oidx, obs):]
iprop = [i for i, k in enumerate(
if k in]
corr_dz = compute_corr_dz(['universe.redshift'], obs['redshift'])[oidx, iprop] *= scaling * corr_dz[oidx, iprop] *= scaling[oidx, :] = fluxes * scaling
if gbl_conf['analysis_params']["save_best_sed"]:
Supports Markdown
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