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

Improve the computation of the histogram bin width in the presence of invalid models.

parent 4766aa5f
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
### Changed ### Changed
### Fixed ### Fixed
- The histogram bin width was not computed optimally when some models were invalid. (David Corre & Médéric Boquien)
### Optimised ### Optimised
- The estimation of the physical properties is made a bit faster when all the models are valid. (Médéric Boquien) - The estimation of the physical properties is made a bit faster when all the models are valid. (Médéric Boquien)
......
...@@ -91,10 +91,13 @@ def _pdf_worker(obj_name, var_name): ...@@ -91,10 +91,13 @@ def _pdf_worker(obj_name, var_name):
model_variable.append(data[1, :]) model_variable.append(data[1, :])
likelihood = np.concatenate(likelihood) likelihood = np.concatenate(likelihood)
model_variable = np.concatenate(model_variable) model_variable = np.concatenate(model_variable)
w = np.where(np.isfinite(likelihood) & np.isfinite(model_variable))
likelihood = likelihood[w]
model_variable = model_variable[w]
Npdf = 100 Npdf = 100
min_hist = np.nanmin(model_variable) min_hist = np.min(model_variable)
max_hist = np.nanmax(model_variable) max_hist = np.max(model_variable)
Nhist = min(Npdf, len(np.unique(model_variable))) Nhist = min(Npdf, len(np.unique(model_variable)))
if min_hist == max_hist: if min_hist == max_hist:
......
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