Commit e43de6dd authored by Guang's avatar Guang

avoid luminosity_distance=nan for photo-z mode

parent 1efe7a25
......@@ -201,8 +201,8 @@ def analysis(idx, obs):
likelihood)
gbl_results.bayes.fluxmean[band][idx] = mean
gbl_results.bayes.fluxerror[band][idx] = std
if gbl_models.conf['analysis_params']['save_chi2'] is True:
save_chi2(obs, band, gbl_models, chi2, values * scaling)
#if gbl_models.conf['analysis_params']['save_chi2'] is True:
# save_chi2(obs, band, gbl_models, chi2, values * scaling)
best_idx_z = np.nanargmin(chi2)
gbl_results.best.chi2[idx] = chi2[best_idx_z]
......@@ -257,7 +257,8 @@ def bestfit(oidx, obs):
# If the distance is user defined, the redshift-based luminosity distance
# of the model is probably incorrect so we replace it
sed.add_info('universe.luminosity_distance', obs.distance, force=True)
if np.isfinite(obs.distance):
sed.add_info('universe.luminosity_distance', obs.distance, force=True)
for prop in gbl_results.best.intprop:
gbl_results.best.intprop[prop][oidx] = sed.info[prop]
......
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