transient_search_using_MCMC.py 1.4 KB
Newer Older
1
#!/usr/bin/env python
Gregory Ashton's avatar
Gregory Ashton committed
2

3
import pyfstat
Gregory Ashton's avatar
Gregory Ashton committed
4
5
6
7

F0 = 30.0
F1 = -1e-10
F2 = 0
8
9
Alpha = 0.5
Delta = 1
Gregory Ashton's avatar
Gregory Ashton committed
10

11
12
13
14
minStartTime = 1000000000
maxStartTime = minStartTime + 200*86400
Tspan = maxStartTime - minStartTime
tref = minStartTime
15
16
17
18
19
20
21
22
23
24
25
26
27
28

DeltaF0 = 6e-7
DeltaF1 = 1e-13

theta_prior = {'F0': {'type': 'unif',
                      'lower': F0-DeltaF0/2.,
                      'upper': F0+DeltaF0/2.},
               'F1': {'type': 'unif',
                      'lower': F1-DeltaF1/2.,
                      'upper': F1+DeltaF1/2.},
               'F2': F2,
               'Alpha': Alpha,
               'Delta': Delta,
               'transient_tstart': {'type': 'unif',
29
30
                                    'lower': minStartTime,
                                    'upper': maxStartTime},
31
               'transient_duration': {'type': 'halfnorm',
32
33
                                      'loc': 0.001*Tspan,
                                      'scale': 0.5*Tspan}
34
35
               }

36
37
38
39
ntemps = 2
log10temperature_min = -1
nwalkers = 100
nsteps = [100, 100]
Gregory Ashton's avatar
Gregory Ashton committed
40

41
42
mcmc = pyfstat.MCMCTransientSearch(
    label='transient_search', outdir='data',
43
    sftfilepattern='data/*simulated_transient_signal*sft',
44
45
    theta_prior=theta_prior, tref=tref, minStartTime=minStartTime,
    maxStartTime=maxStartTime, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
Gregory Ashton's avatar
Gregory Ashton committed
46
47
    log10temperature_min=log10temperature_min)
mcmc.run()
48
mcmc.plot_corner(label_offset=0.7)
Gregory Ashton's avatar
Gregory Ashton committed
49
mcmc.print_summary()