Commit b487455e authored by Médéric Boquien's avatar Médéric Boquien

Move the negative sign to the constant to avoid having to take the negative of...

Move the negative sign to the constant to avoid having to take the negative of an entire array. Also use a multiplication rather than a division (even though a division by 2 is a special case).
parent 029215f6
......@@ -12,6 +12,7 @@
- As the best-fit properties are computed at the exact observed redshift, correct the scaling factor as it is computed at the grid redshift. This corrects for slight offsets on the best-fit properties when the input redshift has more decimals than the grid redshift. (Médéric Boquien)
- Fix the pip install by making pcigale.managers discoverable. (Yannick Roehlly)
### Optimised
- Slight speedup of the computation of the likelihood from the χ² (Médéric Boquien)
## 2018.0 (2018-11-06)
### Added
......
......@@ -153,7 +153,7 @@ def analysis(idx, obs):
if np.any(chi2 < -np.log(np.finfo(np.float64).tiny) * 2.):
# We use the exponential probability associated with the χ² as
# likelihood function.
likelihood = np.exp(-chi2 / 2.)
likelihood = np.exp(-.5 * chi2)
wlikely = np.where(np.isfinite(likelihood))
# If all the models are valid, it is much more efficient to use a slice
if likelihood.size == wlikely[0].size:
......
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