Commit 37041071 authored by Gregory Ashton's avatar Gregory Ashton

Fix up glitch examples for the paper

parent a2e40720
...@@ -43,15 +43,23 @@ mcmc = pyfstat.MCMCGlitchSearch( ...@@ -43,15 +43,23 @@ mcmc = pyfstat.MCMCGlitchSearch(
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
log10beta_min=log10beta_min, nglitch=1) log10beta_min=log10beta_min, nglitch=1)
mcmc.transform_dictionary['F0'] = dict( mcmc.transform_dictionary['F0'] = dict(
subtractor=F0, symbol='$f-f^\mathrm{s}$') subtractor=F0, multiplier=1e6, symbol='$f-f_\mathrm{s}$')
mcmc.unit_dictionary['F0'] = '$\mu$Hz'
mcmc.transform_dictionary['F1'] = dict( mcmc.transform_dictionary['F1'] = dict(
subtractor=F1, symbol='$\dot{f}-\dot{f}^\mathrm{s}$') subtractor=F1, multiplier=1e12, symbol='$\dot{f}-\dot{f}_\mathrm{s}$')
mcmc.unit_dictionary['F1'] = '$p$Hz/s'
mcmc.transform_dictionary['delta_F0'] = dict(
multiplier=1e6, subtractor=delta_F0,
symbol='$\delta f-\delta f_\mathrm{s}$')
mcmc.unit_dictionary['delta_F0'] = '$\mu$Hz/s'
mcmc.transform_dictionary['tglitch']['subtractor'] = tstart + dtglitch
mcmc.transform_dictionary['tglitch']['label'] ='$t^\mathrm{g}-t^\mathrm{g}_\mathrm{s}$\n[d]'
t1 = time.time() t1 = time.time()
mcmc.run() mcmc.run()
dT = time.time() - t1 dT = time.time() - t1
fig_and_axes = gridcorner._get_fig_and_axes(4, 2, 0.05) fig_and_axes = gridcorner._get_fig_and_axes(4, 2, 0.05)
mcmc.plot_corner(label_offset=0.35, truths=[0, 0, delta_F0, 50], mcmc.plot_corner(label_offset=0.25, truths=[0, 0, 0, 0],
fig_and_axes=fig_and_axes) fig_and_axes=fig_and_axes)
mcmc.print_summary() mcmc.print_summary()
......
...@@ -42,18 +42,22 @@ dT = time.time() - t1 ...@@ -42,18 +42,22 @@ dT = time.time() - t1
F0_vals = np.unique(search.data[:, 0]) - F0 F0_vals = np.unique(search.data[:, 0]) - F0
F1_vals = np.unique(search.data[:, 1]) - F1 F1_vals = np.unique(search.data[:, 1]) - F1
delta_F0s_vals = np.unique(search.data[:, 5]) delta_F0s_vals = np.unique(search.data[:, 5]) - delta_F0
tglitch_vals = np.unique(search.data[:, 7]) tglitch_vals = np.unique(search.data[:, 7])
tglitch_vals_days = (tglitch_vals-tstart) / 86400. tglitch_vals_days = (tglitch_vals-tstart) / 86400. - dtglitch/86400.
twoF = search.data[:, -1].reshape((len(F0_vals), len(F1_vals), twoF = search.data[:, -1].reshape((len(F0_vals), len(F1_vals),
len(delta_F0s_vals), len(tglitch_vals))) len(delta_F0s_vals), len(tglitch_vals)))
xyz = [F0_vals, F1_vals, delta_F0s_vals, tglitch_vals_days] xyz = [F0_vals*1e6, F1_vals*1e12, delta_F0s_vals*1e6, tglitch_vals_days]
labels = ['$f - f^\mathrm{s}$\n[Hz]', '$\dot{f} - \dot{f}^\mathrm{s}$\n[Hz/s]', labels = ['$f - f_\mathrm{s}$\n[$\mu$Hz]',
'$\delta f$\n[Hz]', '$t^g_0$\n[days]', '$\widehat{2\mathcal{F}}$'] '$\dot{f} - \dot{f}_\mathrm{s}$\n[$p$Hz/s]',
'$\delta f-\delta f_\mathrm{s}$\n[$\mu$Hz]',
'$t^\mathrm{g} - t^\mathrm{g}_\mathrm{s}$\n[d]',
'$\widehat{2\mathcal{F}}$']
fig, axes = gridcorner( fig, axes = gridcorner(
twoF, xyz, projection='log_mean', labels=labels, twoF, xyz, projection='log_mean', labels=labels,
showDvals=False, lines=[0, 0, delta_F0, dtglitch/86400.], label_offset=0.35) showDvals=False, lines=[0, 0, 0, 0], label_offset=0.25,
max_n_ticks=4)
fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label), fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label),
bbox_inches='tight') bbox_inches='tight')
......
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