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
5ec0b49d
Commit
5ec0b49d
authored
Dec 12, 2017
by
David Keitel
Browse files
transient examples: split into long and short cases
parent
0ec129e9
Changes
5
Hide whitespace changes
Inline
Side-by-side
examples/transient_examples/transient_search_
using_
MCMC.py
→
examples/transient_examples/
long_
transient_search_MCMC.py
View file @
5ec0b49d
...
...
@@ -37,8 +37,8 @@ nwalkers = 100
nsteps
=
[
100
,
100
]
mcmc
=
pyfstat
.
MCMCTransientSearch
(
label
=
'transient_search'
,
outdir
=
'data'
,
sftfilepattern
=
'data/*simulated_transient_signal*sft'
,
label
=
'transient_search'
,
outdir
=
'data
_l
'
,
sftfilepattern
=
'data
_l
/*simulated_transient_signal*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10beta_min
=
log10beta_min
,
...
...
examples/transient_examples/transient_search_
using_MCMC_
make_simulated_data.py
→
examples/transient_examples/
long_
transient_search_make_simulated_data.py
View file @
5ec0b49d
...
...
@@ -19,7 +19,7 @@ h0 = 1e-23
sqrtSX
=
1e-22
transient
=
pyfstat
.
Writer
(
label
=
'simulated_transient_signal'
,
outdir
=
'data'
,
tref
=
tref
,
label
=
'simulated_transient_signal'
,
outdir
=
'data
_l
'
,
tref
=
tref
,
tstart
=
transient_tstart
,
F0
=
F0
,
F1
=
F1
,
F2
=
F2
,
duration
=
transient_duration
,
Alpha
=
Alpha
,
Delta
=
Delta
,
h0
=
h0
,
sqrtSX
=
sqrtSX
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
transientWindowType
=
'rect'
)
...
...
examples/transient_examples/short_transient_search_MCMC.py
0 → 100644
View file @
5ec0b49d
#!/usr/bin/env python
import
pyfstat
F0
=
30.0
F1
=
-
1e-10
F2
=
0
Alpha
=
0.5
Delta
=
1
minStartTime
=
1000000000
maxStartTime
=
minStartTime
+
2
*
86400
Tspan
=
maxStartTime
-
minStartTime
tref
=
minStartTime
Tsft
=
1800
DeltaF0
=
1e-2
DeltaF1
=
1e-9
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'
,
'lower'
:
minStartTime
,
'upper'
:
maxStartTime
-
2
*
Tsft
},
'transient_duration'
:
{
'type'
:
'unif'
,
'lower'
:
2
*
Tsft
,
'upper'
:
Tspan
-
2
*
Tsft
}
}
ntemps
=
2
log10beta_min
=
-
1
nwalkers
=
100
nsteps
=
[
100
,
100
]
mcmc
=
pyfstat
.
MCMCTransientSearch
(
label
=
'transient_search'
,
outdir
=
'data_s'
,
sftfilepattern
=
'data_s/*simulated_transient_signal*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10beta_min
=
log10beta_min
,
transientWindowType
=
'rect'
)
mcmc
.
run
()
mcmc
.
plot_corner
(
label_offset
=
0.7
)
mcmc
.
print_summary
()
examples/transient_examples/short_transient_search_gridded.py
0 → 100644
View file @
5ec0b49d
#!/usr/bin/env python
import
pyfstat
import
numpy
as
np
import
matplotlib.pyplot
as
plt
F0
=
30.0
F1
=
-
1e-10
F2
=
0
Alpha
=
0.5
Delta
=
1
minStartTime
=
1000000000
maxStartTime
=
minStartTime
+
2
*
86400
Tspan
=
maxStartTime
-
minStartTime
tref
=
minStartTime
Tsft
=
1800
m
=
0.001
dF0
=
np
.
sqrt
(
12
*
m
)
/
(
np
.
pi
*
Tspan
)
DeltaF0
=
100
*
dF0
F0s
=
[
F0
-
DeltaF0
/
2.
,
F0
+
DeltaF0
/
2.
,
dF0
]
F1s
=
[
F1
]
F2s
=
[
F2
]
Alphas
=
[
Alpha
]
Deltas
=
[
Delta
]
search
=
pyfstat
.
GridSearch
(
label
=
'grid_search'
,
outdir
=
'data_s'
,
sftfilepattern
=
'data_s/*simulated_transient_signal*sft'
,
F0s
=
F0s
,
F1s
=
F1s
,
F2s
=
F2s
,
Alphas
=
Alphas
,
Deltas
=
Deltas
,
tref
=
tref
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
# transientWindowType='rect', t0Band=Tspan-2*Tsft, tauBand=Tspan,
BSGL
=
False
)
search
.
run
()
search
.
print_max_twoF
()
search
.
plot_1D
(
xkey
=
'F0'
,
xlabel
=
'freq [Hz]'
,
ylabel
=
'$2\mathcal{F}$'
)
search
.
plot_2D
(
xkey
=
'F0'
,
ykey
=
'F1'
)
examples/transient_examples/short_transient_search_make_simulated_data.py
0 → 100644
View file @
5ec0b49d
#!/usr/bin/env python
import
pyfstat
F0
=
30.0
F1
=
-
1e-10
F2
=
0
Alpha
=
0.5
Delta
=
1
minStartTime
=
1000000000
maxStartTime
=
minStartTime
+
2
*
86400
transient_tstart
=
minStartTime
+
0.5
*
86400
transient_duration
=
1
*
86400
tref
=
minStartTime
h0
=
1e-23
sqrtSX
=
1e-22
detectors
=
'H1,L1'
Tsft
=
1800
transient
=
pyfstat
.
Writer
(
label
=
'simulated_transient_signal'
,
outdir
=
'data_s'
,
tref
=
tref
,
tstart
=
transient_tstart
,
duration
=
transient_duration
,
F0
=
F0
,
F1
=
F1
,
F2
=
F2
,
Alpha
=
Alpha
,
Delta
=
Delta
,
h0
=
h0
,
detectors
=
detectors
,
sqrtSX
=
sqrtSX
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
transientWindowType
=
'rect'
,
Tsft
=
Tsft
)
transient
.
make_data
()
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