diff --git a/examples/glitch_examples/make_simulated_data.py b/examples/glitch_examples/make_simulated_data.py index ffa9e3c8378a609a284397f63e14e50ab85f9e1e..f89132371f4eb501c7052a4789739582f4af3bcf 100644 --- a/examples/glitch_examples/make_simulated_data.py +++ b/examples/glitch_examples/make_simulated_data.py @@ -43,15 +43,15 @@ glitch_data.make_data() # Making data with two glitches -dtglitch = [duration/4.0, 4*duration/5.0] -delta_phi = [0, 0] -delta_F0 = [4e-6, 3e-7] -delta_F1 = [0, 0] -delta_F2 = [0, 0] +dtglitch_2 = [duration/4.0, 4*duration/5.0] +delta_phi_2 = [0, 0] +delta_F0_2 = [4e-6, 3e-7] +delta_F1_2 = [0, 0] +delta_F2_2 = [0, 0] two_glitch_data = GlitchWriter( label='2_glitch', outdir=outdir, tref=tref, tstart=tstart, F0=F0, F1=F1, F2=F2, duration=duration, Alpha=Alpha, Delta=Delta, h0=h0, sqrtSX=sqrtSX, - dtglitch=dtglitch, delta_phi=delta_phi, delta_F0=delta_F0, - delta_F1=delta_F1, delta_F2=delta_F2) + dtglitch=dtglitch_2, delta_phi=delta_phi_2, delta_F0=delta_F0_2, + delta_F1=delta_F1_2, delta_F2=delta_F2_2) two_glitch_data.make_data() diff --git a/examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py b/examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py index 15114e0ce45365808531e68be83f2c7728783438..896d7d59d2d68fc14fc5b660bdcca06551a4346e 100644 --- a/examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py +++ b/examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py @@ -1,7 +1,7 @@ import numpy as np import matplotlib.pyplot as plt import pyfstat -from make_simulated_data import tstart, duration, tref, F0, F1, F2, Alpha, Delta, outdir +from make_simulated_data import tstart, duration, tref, F0, F1, F2, Alpha, Delta, delta_F0, dtglitch, outdir plt.style.use('paper') @@ -33,19 +33,19 @@ theta_prior = { ntemps = 3 log10beta_min = -0.5 nwalkers = 100 -nsteps = [500, 500] +nsteps = [500, 1000] mcmc = pyfstat.MCMCGlitchSearch( label=label, sftfilepattern='data/*1_glitch*sft', theta_prior=theta_prior, tref=tref, minStartTime=tstart, maxStartTime=tstart+duration, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, log10beta_min=log10beta_min, nglitch=1) - +print delta_F0 mcmc.transform_dictionary['F0'] = dict( subtractor=F0, symbol='$f-f^\mathrm{s}$') mcmc.transform_dictionary['F1'] = dict( subtractor=F1, symbol='$\dot{f}-\dot{f}^\mathrm{s}$') mcmc.run() -mcmc.plot_corner(label_offset=0.15) +mcmc.plot_corner(label_offset=0.15, truths=[0, 0, delta_F0, 50]) mcmc.print_summary() diff --git a/examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py b/examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py index f8b45ce703fc7c1bf6a3136a11c33dcba2072912..8d33a661b4ea1963888481afa5a943d642bfb2af 100644 --- a/examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py +++ b/examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py @@ -1,7 +1,7 @@ import pyfstat import numpy as np import matplotlib.pyplot as plt -from make_simulated_data import tstart, duration, tref, F0, F1, F2, Alpha, Delta, outdir +from make_simulated_data import tstart, duration, tref, F0, F1, F2, Alpha, Delta, delta_F0, outdir try: from gridcorner import gridcorner @@ -45,9 +45,10 @@ tglitch_vals_days = (tglitch_vals-tstart) / 86400. twoF = search.data[:, -1].reshape((len(F0_vals), len(F1_vals), len(delta_F0s_vals), len(tglitch_vals))) xyz = [F0_vals, F1_vals, delta_F0s_vals, tglitch_vals_days] -labels = ['$f - f_0$\n[Hz]', '$\dot{f} - \dot{f}_0$\n[Hz/s]', +labels = ['$f - f^\mathrm{s}$\n[Hz]', '$\dot{f} - \dot{f}^\mathrm{s}$\n[Hz/s]', '$\delta f$\n[Hz]', '$t^g_0$\n[days]', '$\widehat{2\mathcal{F}}$'] fig, axes = gridcorner( - twoF, xyz, projection='log_mean', whspace=0.1, factor=1.2, labels=labels) + twoF, xyz, projection='log_mean', whspace=0.1, factor=1.2, labels=labels, + showDvals=False, lines=[0, 0, delta_F0, 50]) fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label), bbox_inches='tight')