diff --git a/pcigale/analysis_modules/pdf_analysis/workers.py b/pcigale/analysis_modules/pdf_analysis/workers.py index f2b293c1723b31577a37684c1f942e5011c3f014..e28fae463d413c2285c9839d5445e9558ec1aab4 100644 --- a/pcigale/analysis_modules/pdf_analysis/workers.py +++ b/pcigale/analysis_modules/pdf_analysis/workers.py @@ -252,7 +252,7 @@ def bestfit(oidx, obs): # difference between the object and the grid redshifts. params = deepcopy(gbl_params.from_index(best_index)) if obs.redshift >= 0.: - params[-1]['redshift'] = obs.redshift + params[gbl_params.modules.index('redshifting')]['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])