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

Attempt to fix the fit in the presence of upper limit. For some reason the...

Attempt to fix the fit in the presence of upper limit. For some reason the newton method sometimes does not converge. Patch by Denis Burgarella.
parent 26b39d23
......@@ -261,10 +261,9 @@ def analysis(idx, obs):
if lim_flag == True:
for imod in range(len(model_fluxes)):
norm_facts[imod] = optimize.newton(dchi2_over_ds2,
norm_facts[imod], tol=1e-16,
norm_facts[imod] = optimize.root(dchi2_over_ds2, norm_facts[imod],
args=(obs_fluxes, obs_errors,
model_fluxes[imod, :]))
model_fluxes[imod, :])).x
model_fluxes *= norm_facts[:, np.newaxis]
# χ² of the comparison of each model to each observation.
......
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