Skip to content
GitLab
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
6e0b510a
Commit
6e0b510a
authored
Sep 29, 2017
by
Gregory Ashton
Browse files
Renames log10temperature_min to log10beta_min
The variable name was misleading and hence renamed
parent
4e796984
Changes
12
Hide whitespace changes
Inline
Side-by-side
examples/computing_the_Bayes_factor.py
View file @
6e0b510a
...
...
@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-6)
}
ntemps
=
20
log10
temperature
_min
=
-
2
log10
beta
_min
=
-
2
nwalkers
=
100
nsteps
=
[
500
,
500
]
...
...
@@ -27,7 +27,7 @@ mcmc = MCMCSearch(label='computing_the_Bayes_factor', outdir='data',
sftfilepattern
=
'data/*basic*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
tstart
=
tstart
,
tend
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
()
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
...
...
examples/follow_up.py
View file @
6e0b510a
...
...
@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-5)
}
ntemps
=
1
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
run_setup
=
[(
1000
,
50
),
(
1000
,
25
),
(
1000
,
1
,
False
),
((
500
,
500
),
1
,
True
)]
...
...
@@ -28,7 +28,7 @@ mcmc = pyfstat.MCMCFollowUpSearch(
label
=
'follow_up'
,
outdir
=
'data'
,
sftfilepattern
=
'data/*basic*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
ntemps
=
ntemps
,
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
(
run_setup
,
gen_tex_table
=
True
)
#mcmc.run(Nsegs0=50)
mcmc
.
plot_corner
(
add_prior
=
True
)
...
...
examples/fully_coherent_search_using_MCMC.py
View file @
6e0b510a
...
...
@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps
=
1
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
nsteps
=
[
1000
,
1000
]
...
...
@@ -55,7 +55,7 @@ mcmc = pyfstat.MCMCSearch(
label
=
'fully_coherent_search_using_MCMC'
,
outdir
=
'data'
,
sftfilepattern
=
'data/*'
+
data_label
+
'*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
ntemps
=
ntemps
,
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
(
context
=
'paper'
,
subtractions
=
[
30
,
-
1e-10
],
c
=
2
)
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
examples/fully_coherent_search_using_MCMC_on_glitching_data.py
View file @
6e0b510a
...
...
@@ -21,7 +21,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-1e-4, 'upper': F0+1e-4},
}
ntemps
=
2
log10
temperature
_min
=
-
0.01
log10
beta
_min
=
-
0.01
nwalkers
=
100
nsteps
=
[
500
,
500
]
...
...
@@ -29,7 +29,7 @@ mcmc = MCMCSearch('fully_coherent_search_using_MCMC_on_glitching_data', 'data',
sftfilepattern
=
'data/*_glitch*.sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
()
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
examples/glitch_robust_search.py
View file @
6e0b510a
...
...
@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
search
=
pyfstat
.
MCMCGlitchSearch
(
label
=
label
,
outdir
=
outdir
,
sftfilepattern
=
sftfilepattern
,
theta_prior
=
theta_prior
,
nglitch
=
1
,
tref
=
tref
,
nsteps
=
[
500
,
500
],
ntemps
=
3
,
log10
temperature
_min
=-
0.5
,
minStartTime
=
tstart
,
ntemps
=
3
,
log10
beta
_min
=-
0.5
,
minStartTime
=
tstart
,
maxStartTime
=
tstart
+
Tspan
)
search
.
run
()
search
.
plot_corner
(
label_offset
=
0.8
,
add_prior
=
True
)
...
...
examples/semi_coherent_glitch_search_using_MCMC.py
View file @
6e0b510a
...
...
@@ -25,7 +25,7 @@ theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)},
}
ntemps
=
4
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
nsteps
=
[
5000
,
1000
,
1000
]
...
...
@@ -34,7 +34,7 @@ mcmc = pyfstat.MCMCGlitchSearch(
sftfilepattern
=
'data/*_glitch*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
tstart
=
tstart
,
tend
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
scatter_val
=
1e-10
,
nglitch
=
1
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
()
mcmc
.
plot_corner
(
add_prior
=
True
)
...
...
examples/semi_coherent_search_using_MCMC.py
View file @
6e0b510a
...
...
@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-5)
}
ntemps
=
1
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
nsteps
=
[
500
,
500
,
500
]
...
...
@@ -27,7 +27,7 @@ mcmc = pyfstat.MCMCSemiCoherentSearch(
label
=
'semi_coherent_search_using_MCMC'
,
outdir
=
'data'
,
nsegs
=
20
,
sftfilepattern
=
'data/*basic*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
ntemps
=
ntemps
,
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
()
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
examples/transient_search_using_MCMC.py
View file @
6e0b510a
...
...
@@ -34,7 +34,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps
=
2
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
nsteps
=
[
100
,
100
]
...
...
@@ -43,7 +43,7 @@ mcmc = pyfstat.MCMCTransientSearch(
sftfilepattern
=
'data/*simulated_transient_signal*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
()
mcmc
.
plot_corner
(
label_offset
=
0.7
)
mcmc
.
print_summary
()
examples/twoF_cumulative.py
View file @
6e0b510a
...
...
@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps
=
1
log10
temperature
_min
=
-
1
log10
beta
_min
=
-
1
nwalkers
=
100
nsteps
=
[
50
,
50
]
...
...
@@ -55,7 +55,7 @@ mcmc = pyfstat.MCMCSearch(
label
=
'twoF_cumulative'
,
outdir
=
'data'
,
sftfilepattern
=
'data/*'
+
data_label
+
'*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
)
ntemps
=
ntemps
,
log10
beta_min
=
log10beta
_min
)
mcmc
.
run
(
context
=
'paper'
,
subtractions
=
[
30
,
-
1e-10
])
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
...
...
examples/weak_signal_follow_up.py
View file @
6e0b510a
...
...
@@ -48,7 +48,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-DeltaF0/2.,
}
ntemps
=
3
log10
temperature
_min
=
-
0.5
log10
beta
_min
=
-
0.5
nwalkers
=
100
scatter_val
=
1e-10
nsteps
=
[
100
,
100
]
...
...
@@ -57,7 +57,7 @@ mcmc = pyfstat.MCMCFollowUpSearch(
label
=
'weak_signal_follow_up'
,
outdir
=
'data'
,
sftfilepattern
=
'data/*'
+
data_label
+
'*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nwalkers
=
nwalkers
,
nsteps
=
nsteps
,
ntemps
=
ntemps
,
log10
temperature_min
=
log10temperature
_min
,
ntemps
=
ntemps
,
log10
beta_min
=
log10beta
_min
,
scatter_val
=
scatter_val
)
fig
,
axes
=
plt
.
subplots
(
nrows
=
2
,
ncols
=
2
)
...
...
pyfstat/mcmc_based_searches.py
View file @
6e0b510a
...
...
@@ -48,9 +48,10 @@ class MCMCSearch(core.BaseSearchClass):
nwalkers, ntemps: int,
The number of walkers and temperates to use in the parallel
tempered PTSampler.
log10temperature_min float < 0
The log_10(tmin) value, the set of betas passed to PTSampler are
generated from `np.logspace(0, log10temperature_min, ntemps)`.
log10beta_min float < 0
The log_10(beta) value, if given the set of betas passed to PTSampler
are generated from `np.logspace(0, log10beta_min, ntemps)` (given
in descending order to emcee).
theta_initial: dict, array, (None)
A dictionary of distribution about which to distribute the
initial walkers about
...
...
@@ -101,7 +102,7 @@ class MCMCSearch(core.BaseSearchClass):
def
__init__
(
self
,
label
,
outdir
,
theta_prior
,
tref
,
minStartTime
,
maxStartTime
,
sftfilepattern
=
None
,
detectors
=
None
,
nsteps
=
[
100
,
100
],
nwalkers
=
100
,
ntemps
=
1
,
log10
temperature
_min
=-
5
,
theta_initial
=
None
,
log10
beta
_min
=-
5
,
theta_initial
=
None
,
rhohatmax
=
1000
,
binary
=
False
,
BSGL
=
False
,
SSBprec
=
None
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
injectSources
=
None
,
assumeSqrtSX
=
None
):
...
...
@@ -119,8 +120,8 @@ class MCMCSearch(core.BaseSearchClass):
self
.
pickle_path
=
'{}/{}_saved_data.p'
.
format
(
self
.
outdir
,
self
.
label
)
self
.
_unpack_input_theta
()
self
.
ndim
=
len
(
self
.
theta_keys
)
if
self
.
log10
temperature
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
temperature
_min
,
self
.
ntemps
)
if
self
.
log10
beta
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
beta
_min
,
self
.
ntemps
)
else
:
self
.
betas
=
None
...
...
@@ -138,8 +139,8 @@ class MCMCSearch(core.BaseSearchClass):
logging
.
info
(
'nwalkers={}'
.
format
(
self
.
nwalkers
))
logging
.
info
(
'nsteps = {}'
.
format
(
self
.
nsteps
))
logging
.
info
(
'ntemps = {}'
.
format
(
self
.
ntemps
))
logging
.
info
(
'log10
temperature
_min = {}'
.
format
(
self
.
log10
temperature
_min
))
logging
.
info
(
'log10
beta
_min = {}'
.
format
(
self
.
log10
beta
_min
))
def
_initiate_search_object
(
self
):
logging
.
info
(
'Setting up search object'
)
...
...
@@ -1163,7 +1164,7 @@ class MCMCSearch(core.BaseSearchClass):
d
=
dict
(
nsteps
=
self
.
nsteps
,
nwalkers
=
self
.
nwalkers
,
ntemps
=
self
.
ntemps
,
theta_keys
=
self
.
theta_keys
,
theta_prior
=
self
.
theta_prior
,
log10
temperature
_min
=
self
.
log10
temperature
_min
,
log10
beta
_min
=
self
.
log10
beta
_min
,
BSGL
=
self
.
BSGL
)
return
d
...
...
@@ -1571,7 +1572,7 @@ class MCMCGlitchSearch(MCMCSearch):
def
__init__
(
self
,
label
,
outdir
,
theta_prior
,
tref
,
minStartTime
,
maxStartTime
,
sftfilepattern
=
None
,
detectors
=
None
,
nsteps
=
[
100
,
100
],
nwalkers
=
100
,
ntemps
=
1
,
log10
temperature
_min
=-
5
,
theta_initial
=
None
,
log10
beta
_min
=-
5
,
theta_initial
=
None
,
rhohatmax
=
1000
,
binary
=
False
,
BSGL
=
False
,
SSBprec
=
None
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
injectSources
=
None
,
assumeSqrtSX
=
None
,
...
...
@@ -1586,8 +1587,8 @@ class MCMCGlitchSearch(MCMCSearch):
self
.
pickle_path
=
'{}/{}_saved_data.p'
.
format
(
self
.
outdir
,
self
.
label
)
self
.
_unpack_input_theta
()
self
.
ndim
=
len
(
self
.
theta_keys
)
if
self
.
log10
temperature
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
temperature
_min
,
self
.
ntemps
)
if
self
.
log10
beta
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
beta
_min
,
self
.
ntemps
)
else
:
self
.
betas
=
None
if
args
.
clean
and
os
.
path
.
isfile
(
self
.
pickle_path
):
...
...
@@ -1702,7 +1703,7 @@ class MCMCGlitchSearch(MCMCSearch):
d
=
dict
(
nsteps
=
self
.
nsteps
,
nwalkers
=
self
.
nwalkers
,
ntemps
=
self
.
ntemps
,
theta_keys
=
self
.
theta_keys
,
theta_prior
=
self
.
theta_prior
,
log10
temperature
_min
=
self
.
log10
temperature
_min
,
log10
beta
_min
=
self
.
log10
beta
_min
,
theta0_idx
=
self
.
theta0_idx
,
BSGL
=
self
.
BSGL
)
return
d
...
...
@@ -1780,7 +1781,7 @@ class MCMCSemiCoherentSearch(MCMCSearch):
def
__init__
(
self
,
label
,
outdir
,
theta_prior
,
tref
,
minStartTime
,
maxStartTime
,
sftfilepattern
=
None
,
detectors
=
None
,
nsteps
=
[
100
,
100
],
nwalkers
=
100
,
ntemps
=
1
,
log10
temperature
_min
=-
5
,
theta_initial
=
None
,
log10
beta
_min
=-
5
,
theta_initial
=
None
,
rhohatmax
=
1000
,
binary
=
False
,
BSGL
=
False
,
SSBprec
=
None
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
injectSources
=
None
,
assumeSqrtSX
=
None
,
...
...
@@ -1795,8 +1796,8 @@ class MCMCSemiCoherentSearch(MCMCSearch):
self
.
pickle_path
=
'{}/{}_saved_data.p'
.
format
(
self
.
outdir
,
self
.
label
)
self
.
_unpack_input_theta
()
self
.
ndim
=
len
(
self
.
theta_keys
)
if
self
.
log10
temperature
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
temperature
_min
,
self
.
ntemps
)
if
self
.
log10
beta
_min
:
self
.
betas
=
np
.
logspace
(
0
,
self
.
log10
beta
_min
,
self
.
ntemps
)
else
:
self
.
betas
=
None
if
args
.
clean
and
os
.
path
.
isfile
(
self
.
pickle_path
):
...
...
@@ -1816,7 +1817,7 @@ class MCMCSemiCoherentSearch(MCMCSearch):
d
=
dict
(
nsteps
=
self
.
nsteps
,
nwalkers
=
self
.
nwalkers
,
ntemps
=
self
.
ntemps
,
theta_keys
=
self
.
theta_keys
,
theta_prior
=
self
.
theta_prior
,
log10
temperature
_min
=
self
.
log10
temperature
_min
,
log10
beta
_min
=
self
.
log10
beta
_min
,
BSGL
=
self
.
BSGL
,
nsegs
=
self
.
nsegs
)
return
d
...
...
@@ -1853,7 +1854,7 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
def
_get_data_dictionary_to_save
(
self
):
d
=
dict
(
nwalkers
=
self
.
nwalkers
,
ntemps
=
self
.
ntemps
,
theta_keys
=
self
.
theta_keys
,
theta_prior
=
self
.
theta_prior
,
log10
temperature
_min
=
self
.
log10
temperature
_min
,
log10
beta
_min
=
self
.
log10
beta
_min
,
BSGL
=
self
.
BSGL
,
run_setup
=
self
.
run_setup
)
return
d
...
...
tests.py
View file @
6e0b510a
...
...
@@ -227,7 +227,7 @@ class TestMCMCSearch(Test):
label
=
self
.
label
,
outdir
=
outdir
,
theta_prior
=
theta
,
tref
=
tref
,
sftfilepattern
=
'{}/*{}*sft'
.
format
(
Writer
.
outdir
,
Writer
.
label
),
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
nsteps
=
[
100
,
100
],
nwalkers
=
100
,
ntemps
=
2
,
log10
temperature
_min
=-
1
)
nsteps
=
[
100
,
100
],
nwalkers
=
100
,
ntemps
=
2
,
log10
beta
_min
=-
1
)
search
.
setup_burnin_convergence_testing
()
search
.
run
(
create_plots
=
False
)
_
,
FS
=
search
.
get_max_twoF
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment