Commit 0b151a84 authored by Médéric Boquien's avatar Médéric Boquien

The computation of the fit taking into the upper limits would only work for...

The computation of the fit taking into the upper limits would only work for the first few models because the number of bands was taken as the number of models.
parent 55333ac0
......@@ -20,6 +20,7 @@
- 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)
- When using the `parameters\_file` option, the indices of the models now correspond to the line number of the input file. (Médéric Boquien)
- When using the `parameters\_file` option, the list of modules is read from `sed\_modules` rather than being inferred from the input file. (Médéric Boquien)
- The computation of the upper limits would only work for the first few models, reverting back to regular fits for the others. (Médéric Boquien)
### Optimised
- The cache architecture has been simplified, making it somewhat faster. It speeds up the model generation by ~1%. (Médéric Boquien)
......
......@@ -185,10 +185,11 @@ def compute_chi2(model_fluxes, obs_fluxes, obs_errors, lim_flag):
limits = lim_flag and np.any(obs_errors <= 0.)
scaling = _compute_scaling(model_fluxes, obs_fluxes, obs_errors)
# Some observations may not have flux values in some filter(s), but
# they can have upper limit(s).
if limits == True:
for imod in range(len(model_fluxes)):
for imod in range(scaling.size):
scaling[imod] = optimize.root(dchi2_over_ds2, scaling[imod],
args=(obs_fluxes, obs_errors,
model_fluxes[:, imod])).x
......
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