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
5f1ea2d2
Commit
5f1ea2d2
authored
Nov 21, 2017
by
Gregory Ashton
Browse files
Improvements to estimated run time
parent
e660f2f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/semi_coherent_search_using_MCMC.py
View file @
5f1ea2d2
...
...
@@ -17,7 +17,7 @@ tref = .5*(tstart+tend)
depth
=
10
h0
=
sqrtSX
/
depth
label
=
'semi
_
coherent_search_using_MCMC'
label
=
'semicoherent_search_using_MCMC'
outdir
=
'data'
data
=
pyfstat
.
Writer
(
...
...
@@ -53,7 +53,7 @@ nwalkers = 100
nsteps
=
[
300
,
300
]
mcmc
=
pyfstat
.
MCMCSemiCoherentSearch
(
label
=
label
,
outdir
=
outdir
,
nsegs
=
3
,
label
=
label
,
outdir
=
outdir
,
nsegs
=
10
,
sftfilepattern
=
'{}/*{}*sft'
.
format
(
outdir
,
label
),
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
...
...
pyfstat/mcmc_based_searches.py
View file @
5f1ea2d2
...
...
@@ -416,14 +416,30 @@ class MCMCSearch(core.BaseSearchClass):
tau0S
=
7.3e-5
tau0LD
=
4.2e-7
else
:
tau0S
=
5.0e-5
tau0LD
=
6.2e-8
tau0T
=
1.5e-8
tau0S
=
5.0e-5
tau0C
=
5.6e-6
Nsfts
=
(
self
.
maxStartTime
-
self
.
minStartTime
)
/
1800.
numb_evals
=
np
.
sum
(
self
.
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
a
=
tau0S
*
numb_evals
b
=
tau0LD
*
Nsfts
*
numb_evals
if
hasattr
(
self
,
'run_setup'
):
ts
=
[]
for
row
in
self
.
run_setup
:
nsteps
=
row
[
0
]
nsegs
=
row
[
1
]
numb_evals
=
np
.
sum
(
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
t
=
(
tau0S
+
tau0LD
*
Nsfts
)
*
numb_evals
if
nsegs
>
1
:
t
+=
(
tau0C
+
tau0T
*
Nsfts
)
*
nsegs
*
numb_evals
ts
.
append
(
t
)
time
=
np
.
sum
(
ts
)
else
:
numb_evals
=
np
.
sum
(
self
.
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
time
=
(
tau0S
+
tau0LD
*
Nsfts
)
*
numb_evals
if
getattr
(
self
,
'nsegs'
,
1
)
>
1
:
time
+=
(
tau0C
+
tau0T
*
Nsfts
)
*
self
.
nsegs
*
numb_evals
logging
.
info
(
'Estimated run-time = {} s = {:1.0f}:{:1.0f} m'
.
format
(
a
+
b
,
*
divmod
(
a
+
b
,
60
)))
time
,
*
divmod
(
time
,
60
)))
def
run
(
self
,
proposal_scale_factor
=
2
,
create_plots
=
True
,
window
=
50
,
**
kwargs
):
...
...
@@ -2053,6 +2069,7 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
run_setup
,
NstarMax
=
NstarMax
,
Nsegs0
=
Nsegs0
,
log_table
=
log_table
,
gen_tex_table
=
gen_tex_table
)
self
.
run_setup
=
run_setup
self
.
_estimate_run_time
()
self
.
old_data_is_okay_to_use
=
self
.
_check_old_data_is_okay_to_use
()
if
self
.
old_data_is_okay_to_use
is
True
:
...
...
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