Commit 08f59dbb authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Update all-sky search to address issue of losses

1) Changes the way the prior is built to be wider than the initial box
2) Fixes error where the F0 and F1 where always chosen in the middle of
the box
parent d7535e4c
......@@ -28,8 +28,10 @@ VF0 = VF1 = 100
DeltaF0 = VF0 * np.sqrt(3)/(np.pi*Tspan)
DeltaF1 = VF1 * np.sqrt(45/4.)/(np.pi*Tspan**2)
#depths = np.linspace(100, 400, 7)
depths = [50, 75]
DeltaAlpha = 0.02
DeltaDelta = 0.02
depths = np.linspace(100, 400, 7)
nsteps = 50
run_setup = [((nsteps, 0), 20, False),
......@@ -38,22 +40,15 @@ run_setup = [((nsteps, 0), 20, False),
((nsteps, 0), 3, False),
((nsteps, nsteps), 1, False)]
DeltaAlpha = 0.05
DeltaDelta = 0.05
for depth in depths:
h0 = sqrtSX / float(depth)
F0 = F0_center + np.random.uniform(-0.5, 0.5)*DeltaF0
F1 = F1_center + np.random.uniform(-0.5, 0.5)*DeltaF1
Alpha = np.random.uniform(0, 2*np.pi)
Delta = np.arccos(2*np.random.uniform(0, 1)-1)-np.pi/2
fAlpha = np.random.uniform(0, 1)
Alpha_min = Alpha - DeltaAlpha*(1-fAlpha)
Alpha_max = Alpha + DeltaAlpha*fAlpha
fDelta = np.random.uniform(0, 1)
Delta_min = Delta - DeltaDelta*(1-fDelta)
Delta_max = Delta + DeltaDelta*fDelta
Alpha_center = np.random.uniform(0, 2*np.pi)
Delta_center = np.arccos(2*np.random.uniform(0, 1)-1)-np.pi/2
Alpha = Alpha_center + np.random.uniform(-0.5, 0.5)*DeltaAlpha
Delta = Delta_center + np.random.uniform(-0.5, 0.5)*DeltaDelta
psi = np.random.uniform(-np.pi/4, np.pi/4)
phi = np.random.uniform(0, 2*np.pi)
cosi = np.random.uniform(-1, 1)
......@@ -68,21 +63,21 @@ for depth in depths:
startTime = time.time()
theta_prior = {'F0': {'type': 'unif',
'lower': F0-DeltaF0/2.,
'upper': F0+DeltaF0/2.},
'lower': F0_center-DeltaF0,
'upper': F0_center+DeltaF0},
'F1': {'type': 'unif',
'lower': F1-DeltaF1/2.,
'upper': F1+DeltaF1/2.},
'lower': F1_center-DeltaF1,
'upper': F1_center+DeltaF1},
'F2': F2,
'Alpha': {'type': 'unif',
'lower': Alpha_min,
'upper': Alpha_max},
'lower': Alpha_center-DeltaAlpha,
'upper': Alpha_center+DeltaAlpha},
'Delta': {'type': 'unif',
'lower': Delta_min,
'upper': Delta_max},
'lower': Delta_center-DeltaDelta,
'upper': Delta_center+DeltaDelta},
}
ntemps = 1
ntemps = 2
log10temperature_min = -1
nwalkers = 100
......
import pyfstat
import numpy as np
import os
import time
outdir = 'data'
label = 'run_failures'
data_label = '{}_data'.format(label)
results_file_name = '{}/MCResults_failures.txt'.format(outdir)
# Properties of the GW data
sqrtSX = 2e-23
tstart = 1000000000
Tspan = 100*86400
tend = tstart + Tspan
# Fixed properties of the signal
F0_center = 30
F1_center = 1e-10
F2 = 0
tref = .5*(tstart+tend)
VF0 = VF1 = 100
DeltaF0 = VF0 * np.sqrt(3)/(np.pi*Tspan)
DeltaF1 = VF1 * np.sqrt(45/4.)/(np.pi*Tspan**2)
DeltaAlpha = 0.02
DeltaDelta = 0.02
depths = [140]
nsteps = 50
run_setup = [((nsteps, 0), 20, False),
((nsteps, 0), 11, False),
((nsteps, 0), 6, False),
((nsteps, 0), 3, False),
((nsteps, nsteps), 1, False)]
for depth in depths:
h0 = sqrtSX / float(depth)
F0 = F0_center + np.random.uniform(-0.5, 0.5)*DeltaF0
F1 = F1_center + np.random.uniform(-0.5, 0.5)*DeltaF1
Alpha_center = np.random.uniform(0, 2*np.pi)
Delta_center = np.arccos(2*np.random.uniform(0, 1)-1)-np.pi/2
Alpha = Alpha_center + np.random.uniform(-0.5, 0.5)*DeltaAlpha
Delta = Delta_center + np.random.uniform(-0.5, 0.5)*DeltaDelta
psi = np.random.uniform(-np.pi/4, np.pi/4)
phi = np.random.uniform(0, 2*np.pi)
cosi = np.random.uniform(-1, 1)
data = pyfstat.Writer(
label=data_label, outdir=outdir, tref=tref,
tstart=tstart, F0=F0, F1=F1, F2=F2, duration=Tspan, Alpha=Alpha,
Delta=Delta, h0=h0, sqrtSX=sqrtSX, psi=psi, phi=phi, cosi=cosi,
detector='H1,L1')
data.make_data()
predicted_twoF = data.predict_fstat()
startTime = time.time()
theta_prior = {'F0': {'type': 'unif',
'lower': F0_center-DeltaF0,
'upper': F0_center+DeltaF0},
'F1': {'type': 'unif',
'lower': F1_center-DeltaF1,
'upper': F1_center+DeltaF1},
'F2': F2,
'Alpha': {'type': 'unif',
'lower': Alpha_center-DeltaAlpha,
'upper': Alpha_center+DeltaAlpha},
'Delta': {'type': 'unif',
'lower': Delta_center-DeltaDelta,
'upper': Delta_center+DeltaDelta},
}
theta_prior = {'F0': {'upper': 30.000006381121477, 'lower': 29.999993618878523, 'type': 'unif'}, 'F1': {'upper': 1.0143020701400378e-10, 'lower': 9.8569792985996225e-11, 'type': 'unif'}, 'F2': 0, 'Delta': {'upper': -0.20155527961896461, 'lower': -0.24155527961896459, 'type': 'unif'}, 'Alpha': {'upper': 2.8924321897264367, 'lower': 2.8524321897264366, 'type': 'unif'}}
ntemps = 2
log10temperature_min = -1
nwalkers = 100
mcmc = pyfstat.MCMCFollowUpSearch(
label=label, outdir=outdir,
sftfilepath='{}/*{}*sft'.format(outdir, data_label),
theta_prior=theta_prior,
tref=tref, minStartTime=tstart, maxStartTime=tend,
nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min)
mcmc.run(run_setup=run_setup, create_plots=True, log_table=False,
gen_tex_table=False)
d, maxtwoF = mcmc.get_max_twoF()
print 'MaxtwoF = {}'.format(maxtwoF)
......@@ -23,8 +23,8 @@ VF0 = VF1 = 100
DeltaF0 = VF0 * np.sqrt(3)/(np.pi*Tspan)
DeltaF1 = VF1 * np.sqrt(45/4.)/(np.pi*Tspan**2)
DeltaAlpha = 0.05
DeltaDelta = 0.05
DeltaAlpha = 0.02
DeltaDelta = 0.02
depth = 100
......@@ -41,8 +41,10 @@ theta = np.random.uniform(0, 2*np.pi)
F0 = F0_center + 3*np.sqrt(r)*np.cos(theta)/(np.pi**2 * Tspan**2)
F1 = F1_center + 45*np.sqrt(r)*np.sin(theta)/(4*np.pi**2 * Tspan**4)
Alpha = 0
Delta = 0
Alpha_center = 0
Delta_center = 0
Alpha = Alpha_center + np.random.uniform(-0.5, 0.5)*DeltaAlpha
Delta = Delta_center + np.random.uniform(-0.5, 0.5)*DeltaDelta
psi = np.random.uniform(-np.pi/4, np.pi/4)
phi = np.random.uniform(0, 2*np.pi)
......@@ -57,21 +59,21 @@ data.make_data()
predicted_twoF = data.predict_fstat()
theta_prior = {'F0': {'type': 'unif',
'lower': F0-DeltaF0/2.,
'upper': F0+DeltaF0/2.},
'lower': F0_center-DeltaF0,
'upper': F0_center+DeltaF0},
'F1': {'type': 'unif',
'lower': F1-DeltaF1/2.,
'upper': F1+DeltaF1/2.},
'lower': F1_center-DeltaF1,
'upper': F1_center+DeltaF1},
'F2': F2,
'Alpha': {'type': 'unif',
'lower': Alpha-DeltaAlpha/2.,
'upper': Alpha+DeltaAlpha/2.},
'lower': Alpha_center-DeltaAlpha,
'upper': Alpha_center+DeltaAlpha},
'Delta': {'type': 'unif',
'lower': Delta-DeltaDelta/2.,
'upper': Delta+DeltaDelta/2.},
'lower': Delta_center-DeltaDelta,
'upper': Delta_center+DeltaDelta},
}
ntemps = 1
ntemps = 2
log10temperature_min = -1
nwalkers = 100
......@@ -82,4 +84,5 @@ mcmc = pyfstat.MCMCFollowUpSearch(
tref=tref, minStartTime=tstart, maxStartTime=tend,
nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min)
mcmc.run(run_setup)
mcmc.run(Nsegs0=20, R=10)
#mcmc.run(run_setup)
\begin{tabular}{c|cccccc}
Stage & $\Nseg$ & $\Tcoh^{\rm days}$ &$\Nsteps$ & $\V$ & $\Vsky$ & $\Vpe$ \\ \hline
0 & 20 & 5.0 & 50 & $2{\times}10^{2}$ & 10.0 & 10.0 \\
1 & 11 & 9.1 & 50 & $2{\times}10^{3}$ & 40.0 & 50.0 \\
2 & 6 & 16.7 & 50 & $2{\times}10^{4}$ & $1{\times}10^{2}$ & $2{\times}10^{2}$ \\
3 & 3 & 33.3 & 50 & $1{\times}10^{5}$ & $2{\times}10^{2}$ & $6{\times}10^{2}$ \\
4 & 1 & 100.0 & 50,50 & $8{\times}10^{5}$ & $3{\times}10^{2}$ & $2{\times}10^{3}$ \\
0 & 20 & 5.0 & 100 & $4{\times}10^{2}$ & 8.0 & 60.0 \\
1 & 11 & 9.1 & 100 & $4{\times}10^{3}$ & 20.0 & $2{\times}10^{2}$ \\
2 & 6 & 16.7 & 100 & $4{\times}10^{4}$ & 70.0 & $6{\times}10^{2}$ \\
3 & 3 & 33.3 & 100 & $3{\times}10^{5}$ & $1{\times}10^{2}$ & $2{\times}10^{3}$ \\
4 & 1 & 100.0 & 100,100 & $2{\times}10^{6}$ & $2{\times}10^{2}$ & $1{\times}10^{4}$ \\
\end{tabular}
......@@ -1002,7 +1002,8 @@ in Figure~\ref{fig_allsky_MC_follow_up}.
\begin{table}[htb]
\caption{Run-setup for the all-sky follow-up Monte-Carlo study, generated with
$\mathcal{R}=10$ and $\Nseg^0=20$.}
$\mathcal{R}=10$ and $\Nseg^0=20$. Note that the number of representative
templates will vary over the sky. \comment{Hmm?}}
\label{tab_allsky_MC_follow_up}
\input{allsky_setup_run_setup}
\end{table}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment