Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyFstat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pep Covas Vidal
PyFstat
Commits
0e89feb6
Commit
0e89feb6
authored
8 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Update Directed MC to new format of run_setup
parent
78ab5b6d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Paper/DirectedMC/generate_data.py
+14
-7
14 additions, 7 deletions
Paper/DirectedMC/generate_data.py
Paper/DirectedMC/generate_table.py
+76
-0
76 additions, 0 deletions
Paper/DirectedMC/generate_table.py
Paper/DirectedMC/plot_data.py
+1
-1
1 addition, 1 deletion
Paper/DirectedMC/plot_data.py
with
91 additions
and
8 deletions
Paper/DirectedMC/generate_data.py
+
14
−
7
View file @
0e89feb6
...
...
@@ -2,6 +2,8 @@ import pyfstat
import
numpy
as
np
import
os
import
sys
import
time
ID
=
sys
.
argv
[
1
]
outdir
=
sys
.
argv
[
2
]
...
...
@@ -32,15 +34,19 @@ DeltaF1 = VF1 * np.sqrt(45/4.)/(np.pi*Tspan**2)
depths
=
np
.
linspace
(
100
,
400
,
7
)
depths
=
[
125
,
175
]
run_setup
=
[((
10
,
0
),
16
,
False
),
((
10
,
0
),
5
,
False
),
((
10
,
10
),
1
,
False
)]
nsteps
=
20
run_setup
=
[((
nsteps
,
0
),
20
,
False
),
((
nsteps
,
0
),
7
,
False
),
((
nsteps
,
0
),
2
,
False
),
((
nsteps
,
nsteps
),
1
,
False
)]
for
depth
in
depths
:
startTime
=
time
.
time
()
h0
=
sqrtSX
/
float
(
depth
)
r
=
np
.
random
.
uniform
(
0
,
1
)
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
)
F0
=
F0_center
+
np
.
random
.
uniform
(
-
0.5
,
0.5
)
*
DeltaF0
F1
=
F1_center
+
np
.
random
.
uniform
(
-
0.5
,
0.5
)
*
DeltaF1
psi
=
np
.
random
.
uniform
(
-
np
.
pi
/
4
,
np
.
pi
/
4
)
phi
=
np
.
random
.
uniform
(
0
,
2
*
np
.
pi
)
...
...
@@ -81,7 +87,8 @@ for depth in depths:
d
,
maxtwoF
=
mcmc
.
get_max_twoF
()
dF0
=
F0
-
d
[
'
F0
'
]
dF1
=
F1
-
d
[
'
F1
'
]
runTime
=
time
.
time
()
-
startTime
with
open
(
results_file_name
,
'
a
'
)
as
f
:
f
.
write
(
'
{} {:1.8e} {:1.8e} {:1.8e} {:1.8e} {:1.8e}
\n
'
.
format
(
depth
,
h0
,
dF0
,
dF1
,
predicted_twoF
,
maxtwoF
))
f
.
write
(
'
{} {:1.8e} {:1.8e} {:1.8e} {:1.8e} {:1.8e}
{}
\n
'
.
format
(
depth
,
h0
,
dF0
,
dF1
,
predicted_twoF
,
maxtwoF
,
runTime
))
os
.
system
(
'
rm {}/*{}*
'
.
format
(
outdir
,
label
))
This diff is collapsed.
Click to expand it.
Paper/DirectedMC/generate_table.py
0 → 100644
+
76
−
0
View file @
0e89feb6
import
pyfstat
import
numpy
as
np
outdir
=
'
data
'
label
=
'
directed_setup
'
data_label
=
'
{}_data
'
.
format
(
label
)
# 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
Alpha
=
5e-3
Delta
=
6e-2
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
)
depth
=
100
nsteps
=
50
run_setup
=
[((
nsteps
,
0
),
20
,
False
),
((
nsteps
,
0
),
7
,
False
),
((
nsteps
,
0
),
2
,
False
),
((
nsteps
,
nsteps
),
1
,
False
)]
h0
=
sqrtSX
/
float
(
depth
)
r
=
np
.
random
.
uniform
(
0
,
1
)
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
)
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
()
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
}
ntemps
=
1
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
)
This diff is collapsed.
Click to expand it.
Paper/DirectedMC/plot_data.py
+
1
−
1
View file @
0e89feb6
...
...
@@ -29,7 +29,7 @@ results_file_name = 'MCResults.txt'
df
=
pd
.
read_csv
(
results_file_name
,
sep
=
'
'
,
names
=
[
'
depth
'
,
'
h0
'
,
'
dF0
'
,
'
dF1
'
,
'
twoF_predicted
'
,
'
twoF
'
])
'
twoF_predicted
'
,
'
twoF
'
,
'
runTime
'
])
twoFstar
=
60
depths
=
np
.
unique
(
df
.
depth
.
values
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment