weak_signal_follow_up.py 1.97 KB
Newer Older
1
import pyfstat
2
3
import numpy as np
import matplotlib.pyplot as plt
4
5

F0 = 30.0
6
F1 = -1e-10
7
F2 = 0
8
9
Alpha = 1.0
Delta = 0.5
10
11
12
13
14
15

# Properties of the GW data
sqrtSX = 1e-23
tstart = 1000000000
duration = 100*86400
tend = tstart+duration
16
tref = .5*(tstart+tend)
17

18
depth = 50
19
data_label = 'weak_signal_follow_up_depth_{:1.0f}'.format(depth)
20
21
22
23

h0 = sqrtSX / depth

data = pyfstat.Writer(
24
    label=data_label, outdir='data', tref=tref,
25
26
27
28
29
30
31
32
33
    tstart=tstart, F0=F0, F1=F1, F2=F2, duration=duration, Alpha=Alpha,
    Delta=Delta, h0=h0, sqrtSX=sqrtSX)
data.make_data()

# The predicted twoF, given by lalapps_predictFstat can be accessed by
twoF = data.predict_fstat()
print 'Predicted twoF value: {}\n'.format(twoF)

# Search
34
35
36
37
38
39
40
41
42
VF0 = VF1 = 500
DeltaF0 = VF0 * np.sqrt(3)/(np.pi*duration)
DeltaF1 = VF1 * np.sqrt(45/4.)/(np.pi*duration**2)
DeltaAlpha = 1e-1
DeltaDelta = 1e-1
theta_prior = {'F0': {'type': 'unif', 'lower': F0-DeltaF0/2.,
                      'upper': F0+DeltaF0/2},
               'F1': {'type': 'unif', 'lower': F1-DeltaF1/2.,
                      'upper': F1+DeltaF1/2},
43
               'F2': F2,
44
45
46
47
               'Alpha': {'type': 'unif', 'lower': Alpha-DeltaAlpha,
                         'upper': Alpha+DeltaAlpha},
               'Delta': {'type': 'unif', 'lower': Delta-DeltaDelta,
                         'upper': Delta+DeltaDelta},
48
49
               }

50
ntemps = 3
51
log10beta_min = -0.5
52
nwalkers = 100
53
scatter_val = 1e-10
54
nsteps = [100, 100]
55
56
57

mcmc = pyfstat.MCMCFollowUpSearch(
    label='weak_signal_follow_up', outdir='data',
58
    sftfilepattern='data/*'+data_label+'*sft', theta_prior=theta_prior, tref=tref,
59
    minStartTime=tstart, maxStartTime=tend, nwalkers=nwalkers, nsteps=nsteps,
60
    ntemps=ntemps, log10beta_min=log10beta_min,
61
    scatter_val=scatter_val)
62
63
64
65
66
67

fig, axes = plt.subplots(nrows=2, ncols=2)
mcmc.run(
    R=10, Nsegs0=100, subtractions=[F0, F1, Alpha, Delta], context='paper',
    fig=fig, axes=axes, plot_det_stat=False, return_fig=True)

68
69
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()