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

Exclude invalid models when computing the Bayesian estimates of physical properties.

parent d4b40d81
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
### Changed ### Changed
### Fixed ### Fixed
- The best fit could not be computed in photo-z mode because the redshift was negative. (Médéric Boquien) - The best fit could not be computed in photo-z mode because the redshift was negative. (Médéric Boquien)
- The bayesian estimates could not be computed when some models were older than the age of the universe. (Médéric Boquien)
### Optimised ### Optimised
......
...@@ -193,7 +193,8 @@ def analysis(idx, obs): ...@@ -193,7 +193,8 @@ def analysis(idx, obs):
else: else:
values = _(gbl_models.properties[i, wz]) values = _(gbl_models.properties[i, wz])
mean, std = weighted_param(values, likelihood) wlikely = np.where(np.isfinite(likelihood))
mean, std = weighted_param(values[wlikely], likelihood[wlikely])
gbl_results.bayes.means[idx, i] = mean gbl_results.bayes.means[idx, i] = mean
gbl_results.bayes.errors[idx, i] = std gbl_results.bayes.errors[idx, i] = std
if gbl_models.conf['analysis_params']['save_chi2'] is True: if gbl_models.conf['analysis_params']['save_chi2'] is True:
......
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