Commit 4fa3759b authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Improvements to output of follow-up procedure

1) Adds Tcoh to plots
2) prints max det stat
3) Fixes total number of stages
parent cc0ca10a
...@@ -1603,7 +1603,7 @@ _ sftfilepath: str ...@@ -1603,7 +1603,7 @@ _ sftfilepath: str
theta_initial: dict, array, (None) theta_initial: dict, array, (None)
Either a dictionary of distribution about which to distribute the Either a dictionary of distribution about which to distribute the
initial walkers about, an array (from which the walkers will be initial walkers about, an array (from which the walkers will be
scattered by scatter_val, or None in which case the prior is used. scattered by scatter_val), or None in which case the prior is used.
scatter_val, float or ndim array scatter_val, float or ndim array
Size of scatter to use about the initialisation step, if given as Size of scatter to use about the initialisation step, if given as
an array it must be of length ndim and the order is given by an array it must be of length ndim and the order is given by
...@@ -1957,10 +1957,10 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch): ...@@ -1957,10 +1957,10 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
loglargs=(self.search,), betas=self.betas, loglargs=(self.search,), betas=self.betas,
a=proposal_scale_factor) a=proposal_scale_factor)
Tcoh = (self.maxStartTime-self.minStartTime)/nseg/86400.
logging.info(('Running {}/{} with {} steps and {} nsegs ' logging.info(('Running {}/{} with {} steps and {} nsegs '
'(Tcoh={:1.2f} days)').format( '(Tcoh={:1.2f} days)').format(
j+1, len(self.nsteps), (nburn, nprod), nseg, j+1, len(run_setup), (nburn, nprod), nseg, Tcoh))
(self.maxStartTime-self.minStartTime)/nseg/86400))
sampler = self.run_sampler_with_progress_bar( sampler = self.run_sampler_with_progress_bar(
sampler, nburn+nprod, p0) sampler, nburn+nprod, p0)
logging.info("Mean acceptance fraction: {}" logging.info("Mean acceptance fraction: {}"
...@@ -1968,10 +1968,17 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch): ...@@ -1968,10 +1968,17 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
if self.ntemps > 1: if self.ntemps > 1:
logging.info("Tswap acceptance fraction: {}" logging.info("Tswap acceptance fraction: {}"
.format(sampler.tswap_acceptance_fraction)) .format(sampler.tswap_acceptance_fraction))
logging.info('Max detection statistic of run was {}'.format(
np.max(sampler.lnlikelihood)))
fig, axes = self.plot_walkers(sampler, symbols=self.theta_symbols, fig, axes = self.plot_walkers(sampler, symbols=self.theta_symbols,
fig=fig, axes=axes, burnin_idx=nburn, fig=fig, axes=axes, burnin_idx=nburn,
xoffset=nsteps_total) xoffset=nsteps_total)
yvals = axes[0].get_ylim()
axes[0].annotate(
r'$T_{{\rm coh}}^{{\rm (days)}}{{=}}{:1.1f}$'.format(Tcoh),
xy=(nsteps_total, yvals[0]*(1+1e-2*(yvals[1]-yvals[0])/yvals[1])),
fontsize=6)
for ax in axes[:-1]: for ax in axes[:-1]:
ax.axvline(nsteps_total, color='k', ls='--') ax.axvline(nsteps_total, color='k', ls='--')
nsteps_total += nburn+nprod nsteps_total += nburn+nprod
......
Supports Markdown
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