Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gregory Ashton
PyFstat
Commits
fdc3033a
Commit
fdc3033a
authored
Nov 08, 2016
by
Gregory Ashton
Browse files
Adds new example for a weak signal follow-up
parent
ad1d6a24
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/weak_signal_follow_up.py
0 → 100644
View file @
fdc3033a
import
pyfstat
# Define parameters of the Crab pulsar as an example
F0
=
30.0
F1
=
-
1e-10
F2
=
0
Alpha
=
5e-3
Delta
=
6e-2
tref
=
362750407.0
# Properties of the GW data
sqrtSX
=
1e-23
tstart
=
1000000000
duration
=
100
*
86400
tend
=
tstart
+
duration
depth
=
50
h0
=
sqrtSX
/
depth
data
=
pyfstat
.
Writer
(
label
=
'depth_{:1.0f}'
.
format
(
depth
),
outdir
=
'data'
,
tref
=
tref
,
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
theta_prior
=
{
'F0'
:
{
'type'
:
'unif'
,
'lower'
:
F0
*
(
1
-
1e-4
),
'upper'
:
F0
*
(
1
+
1e-4
)},
'F1'
:
{
'type'
:
'unif'
,
'lower'
:
F1
*
(
1
+
1e-2
),
'upper'
:
F1
*
(
1
-
1e-2
)},
'F2'
:
F2
,
'Alpha'
:
{
'type'
:
'unif'
,
'lower'
:
Alpha
-
1e-2
,
'upper'
:
Alpha
+
1e-2
},
'Delta'
:
{
'type'
:
'unif'
,
'lower'
:
Delta
-
5e-2
,
'upper'
:
Delta
+
5e-2
},
}
ntemps
=
1
log10temperature_min
=
-
1
nwalkers
=
100
run_setup
=
[(
1000
,
50
),
(
1000
,
30
),
(
1000
,
20
),
(
1000
,
15
),
(
1000
,
10
),
(
1000
,
5
),
(
1000
,
1
),
((
1000
,
1000
),
1
,
True
)]
mcmc
=
pyfstat
.
MCMCFollowUpSearch
(
label
=
'weak_signal_follow_up'
,
outdir
=
'data'
,
sftfilepath
=
'data/*depth*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10temperature_min
=
log10temperature_min
)
mcmc
.
run
(
run_setup
)
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
mcmc
.
generate_loudest
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment