Commit 61607088 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Add check to ignore det stat plot if all det stat values are the same

parent f770b66c
...@@ -1458,13 +1458,23 @@ class MCMCSearch(BaseSearchClass): ...@@ -1458,13 +1458,23 @@ class MCMCSearch(BaseSearchClass):
lnl = sampler.lnlikelihood[temp, :, :] lnl = sampler.lnlikelihood[temp, :, :]
if burnin_idx and add_det_stat_burnin: if burnin_idx and add_det_stat_burnin:
burn_in_vals = lnl[:, :burnin_idx].flatten() burn_in_vals = lnl[:, :burnin_idx].flatten()
axes[-1].hist(burn_in_vals[~np.isnan(burn_in_vals)], bins=50, try:
histtype='step', color='r') axes[-1].hist(burn_in_vals[~np.isnan(burn_in_vals)],
bins=50, histtype='step', color='r')
except ValueError:
logging.info('Det. Stat. hist failed, most likely all '
'values where the same')
pass
else: else:
burn_in_vals = [] burn_in_vals = []
prod_vals = lnl[:, burnin_idx:].flatten() prod_vals = lnl[:, burnin_idx:].flatten()
axes[-1].hist(prod_vals[~np.isnan(prod_vals)], bins=50, try:
histtype='step', color='k') axes[-1].hist(prod_vals[~np.isnan(prod_vals)], bins=50,
histtype='step', color='k')
except ValueError:
logging.info('Det. Stat. hist failed, most likely all '
'values where the same')
pass
if self.BSGL: if self.BSGL:
axes[-1].set_xlabel(r'$\mathcal{B}_\mathrm{S/GL}$') axes[-1].set_xlabel(r'$\mathcal{B}_\mathrm{S/GL}$')
else: else:
......
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