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

Fix the computation of the plot of the PDF for physical properties in log.

parent 8d3ffd7e
......@@ -12,6 +12,7 @@
### Fixed
- The histogram bin width was not computed optimally when some models were invalid. (David Corre & Médéric Boquien)
- Missing import in the `m2005` module. (Médéric Boquien, reported by Dominika Wylezalek)
- The plot of the PDF could not be generated for physical properties estimated in log (Médéric Boquien)
### Optimised
- The estimation of the physical properties is made a bit faster when all the models are valid. (Médéric Boquien)
......@@ -79,8 +79,14 @@ def _pdf_worker(obj_name, var_name):
Name of the analysed variable..
fnames = glob.glob("out/{}_{}_chi2-block-*.npy".format(obj_name, var_name))
if var_name.endswith('_log'):
fnames = glob.glob("out/{}_{}_chi2-block-*.npy".format(obj_name,
log = True
fnames = glob.glob("out/{}_{}_chi2-block-*.npy".format(obj_name,
log = False
likelihood = []
model_variable = []
for fname in fnames:
......@@ -91,6 +97,8 @@ def _pdf_worker(obj_name, var_name):
model_variable.append(data[1, :])
likelihood = np.concatenate(likelihood)
model_variable = np.concatenate(model_variable)
if log is True:
model_variable = np.log10(model_variable)
w = np.where(np.isfinite(likelihood) & np.isfinite(model_variable))
likelihood = likelihood[w]
model_variable = model_variable[w]
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