Commit fea97ceb authored by Yannick Roehlly's avatar Yannick Roehlly

Correct normalisation factor formula

Thanks to Médéric Boquien.
The normalisation factor must take into account the error associated
with each filter flux.
parent b4b4bcd1
......@@ -571,8 +571,10 @@ def compute_chi2(model_fluxes, obs_fluxes, obs_errors):
normalisation_factor = np.sum(obs_fluxes) / np.sum(model_fluxes)
probability = 1
else:
normalisation_factor = (np.sum(obs_fluxes * model_fluxes) /
np.sum(model_fluxes * model_fluxes))
normalisation_factor = (np.sum(obs_fluxes * model_fluxes /
(obs_errors * obs_errors)) /
np.sum(model_fluxes * model_fluxes /
(obs_errors * obs_errors)))
norm_model_fluxes = normalisation_factor * model_fluxes
chi2 = np.sum(np.square((obs_fluxes - norm_model_fluxes) /
obs_errors))
......
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