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 os
11
12 import numpy as np
13 from PyFstat_example_make_data_for_search_on_1_glitch import (
14     F0,
15     F1,
16     F2,
17     Alpha,
18     Delta,
19     duration,
20     outdir,
21     tref,
22     tstart,
23 )
24
25 import pyfstat
26
27 label = "PyFstat_example_standard_directed_MCMC_search_on_1_glitch"
28
29 Nstar = 10000
30 F0_width = np.sqrt(Nstar) * np.sqrt(12) / (np.pi * duration)
31 F1_width = np.sqrt(Nstar) * np.sqrt(180) / (np.pi * duration**2)
32
33 theta_prior = {
34     "F0": {"type": "unif", "lower": F0 - F0_width / 2.0, "upper": F0 + F0_width / 2.0},
35     "F1": {"type": "unif", "lower": F1 - F1_width / 2.0, "upper": F1 + F1_width / 2.0},
36     "F2": F2,
37     "Alpha": Alpha,
38     "Delta": Delta,
39 }
40
41 ntemps = 2
42 log10beta_min = -0.5
43 nwalkers = 100
44 nsteps = [500, 2000]
45
46 mcmc = pyfstat.MCMCSearch(
47     label=label,
48     outdir=outdir,
49     sftfilepattern=os.path.join(outdir, "*1_glitch*sft"),
50     theta_prior=theta_prior,
51     tref=tref,
52     minStartTime=tstart,
53     maxStartTime=tstart + duration,
54     nsteps=nsteps,
55     nwalkers=nwalkers,
56     ntemps=ntemps,
57     log10beta_min=log10beta_min,
58 )
59
60 mcmc.transform_dictionary["F0"] = dict(subtractor=F0, symbol="$f-f^\\mathrm{s}$")
61 mcmc.transform_dictionary["F1"] = dict(
62     subtractor=F1, symbol="$\\dot{f}-\\dot{f}^\\mathrm{s}$"
63 )
64
65 mcmc.run()
66 mcmc.print_summary()
67 mcmc.plot_corner()
68 mcmc.plot_cumulative_max(savefig=True)

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery