Note
Click here to download the full example code
MCMC search on data presenting a glitch
Executes a directed MCMC semicoherent F-statistic search on data presenting a glitch. This is intended to show the impact of glitches on vanilla CW searches.
10 import numpy as np
11 import pyfstat
12 from PyFstat_example_make_data_for_search_on_1_glitch import (
13 tstart,
14 duration,
15 tref,
16 F0,
17 F1,
18 F2,
19 Alpha,
20 Delta,
21 outdir,
22 )
23 import os
24
25 label = "PyFstat_example_standard_directed_MCMC_search_on_1_glitch"
26
27 Nstar = 10000
28 F0_width = np.sqrt(Nstar) * np.sqrt(12) / (np.pi * duration)
29 F1_width = np.sqrt(Nstar) * np.sqrt(180) / (np.pi * duration**2)
30
31 theta_prior = {
32 "F0": {"type": "unif", "lower": F0 - F0_width / 2.0, "upper": F0 + F0_width / 2.0},
33 "F1": {"type": "unif", "lower": F1 - F1_width / 2.0, "upper": F1 + F1_width / 2.0},
34 "F2": F2,
35 "Alpha": Alpha,
36 "Delta": Delta,
37 }
38
39 ntemps = 2
40 log10beta_min = -0.5
41 nwalkers = 100
42 nsteps = [500, 2000]
43
44 mcmc = pyfstat.MCMCSearch(
45 label=label,
46 outdir=outdir,
47 sftfilepattern=os.path.join(outdir, "*1_glitch*sft"),
48 theta_prior=theta_prior,
49 tref=tref,
50 minStartTime=tstart,
51 maxStartTime=tstart + duration,
52 nsteps=nsteps,
53 nwalkers=nwalkers,
54 ntemps=ntemps,
55 log10beta_min=log10beta_min,
56 )
57
58 mcmc.transform_dictionary["F0"] = dict(subtractor=F0, symbol="$f-f^\\mathrm{s}$")
59 mcmc.transform_dictionary["F1"] = dict(
60 subtractor=F1, symbol="$\\dot{f}-\\dot{f}^\\mathrm{s}$"
61 )
62
63 mcmc.run()
64 mcmc.print_summary()
65 mcmc.plot_corner()
66 mcmc.plot_cumulative_max(savefig=True)
Total running time of the script: ( 0 minutes 0.000 seconds)