semi_coherent_twoglitch_search_using_MCMC.py 1.39 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pyfstat

F0 = 30.0
F1 = -1e-10
F2 = 0
Alpha = 5e-3
Delta = 6e-2
tref = 362750407.0

tstart = 1000000000
duration = 100*86400
tend = tstart + duration

theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)},
               'F1': {'type': 'norm', 'loc': F1, 'scale': abs(1e-6*F1)},
               'F2': F2,
               'Alpha': Alpha,
               'Delta': Delta,
19
20
21
22
23
24
               'delta_F0_0': {'type': 'halfnorm', 'loc': 0,
                              'scale': 1e-7*F0},
               'delta_F0_1': {'type': 'halfnorm', 'loc': 0,
                              'scale': 1e-7*F0},
               'delta_F1_0': 0,
               'delta_F1_1': 0,
25
26
27
28
29
30
               'tglitch_0': {'type': 'unif',
                             'lower': tstart+0.01*duration,
                             'upper': tstart+0.5*duration},
               'tglitch_1': {'type': 'unif',
                             'lower': tstart+0.5*duration,
                             'upper': tstart+0.99*duration},
31
32
               }

33
34
nwalkers = 100
nsteps = [1000, 1000, 5000]
35
36

mcmc = pyfstat.MCMCGlitchSearch(
37
    'semi_coherent_twoglitch_search', 'data', sftfilepattern='data/*twoglitch*sft',
38
    theta_prior=theta_prior, tref=tref, tstart=tstart,
39
40
41
42
43
    tend=tend, nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=2)

mcmc.run()
mcmc.plot_corner(add_prior=True, tglitch_ratio=True, figsize=(10, 10))
mcmc.print_summary()