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
David Keitel
PyFstat
Commits
5837254c
Commit
5837254c
authored
Aug 09, 2017
by
Gregory Ashton
Browse files
Adds from __future__ imports to an in Python3 compaitibility
parent
e4dce426
Changes
7
Hide whitespace changes
Inline
Side-by-side
examples/follow_up.py
View file @
5837254c
...
...
@@ -21,7 +21,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-5)
ntemps
=
1
log10temperature_min
=
-
1
nwalkers
=
100
run_setup
=
[(
1000
,
50
),
(
1000
,
25
),
(
1000
,
1
,
False
),
run_setup
=
[(
1000
,
50
),
(
1000
,
25
),
(
1000
,
1
,
False
),
((
500
,
500
),
1
,
True
)]
mcmc
=
pyfstat
.
MCMCFollowUpSearch
(
...
...
@@ -29,6 +29,7 @@ mcmc = pyfstat.MCMCFollowUpSearch(
sftfilepattern
=
'data/*basic*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10temperature_min
=
log10temperature_min
)
mcmc
.
run
(
run_setup
)
mcmc
.
run
(
run_setup
,
gen_tex_table
=
True
)
#mcmc.run(Nsegs0=50)
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
examples/fully_coherent_search_using_MCMC.py
View file @
5837254c
...
...
@@ -48,14 +48,14 @@ theta_prior = {'F0': {'type': 'unif',
ntemps
=
1
log10temperature_min
=
-
1
nwalkers
=
100
0
nsteps
=
[
50
,
5
0
]
nwalkers
=
100
nsteps
=
[
1000
,
100
0
]
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
,
log10temperature_min
=
log10temperature_min
)
mcmc
.
run
(
context
=
'paper'
,
subtractions
=
[
30
,
-
1e-10
])
mcmc
.
run
(
context
=
'paper'
,
subtractions
=
[
30
,
-
1e-10
]
,
c
=
2
)
mcmc
.
plot_corner
(
add_prior
=
True
)
mcmc
.
print_summary
()
pyfstat/core.py
View file @
5837254c
""" The core tools used in pyfstat """
from
__future__
import
division
,
absolute_import
,
print_function
import
os
import
logging
import
copy
import
glob
import
numpy
as
np
import
scipy.special
...
...
@@ -10,7 +13,7 @@ import scipy.optimize
import
lal
import
lalpulsar
import
helper_functions
import
pyfstat.helper_functions
as
helper_functions
# workaround for matplotlib on X-less remote logins
if
'DISPLAY'
in
os
.
environ
:
...
...
pyfstat/grid_based_searches.py
View file @
5837254c
""" Searches using grid-based methods """
from
__future__
import
division
,
absolute_import
,
print_function
import
os
import
logging
...
...
@@ -9,9 +10,10 @@ import numpy as np
import
matplotlib
import
matplotlib.pyplot
as
plt
import
helper_functions
from
core
import
BaseSearchClass
,
ComputeFstat
,
SemiCoherentGlitchSearch
,
SemiCoherentSearch
from
core
import
tqdm
,
args
,
earth_ephem
,
sun_ephem
,
read_par
import
pyfstat.helper_functions
as
helper_functions
from
pyfstat.core
import
(
BaseSearchClass
,
ComputeFstat
,
SemiCoherentGlitchSearch
,
SemiCoherentSearch
,
tqdm
,
args
,
earth_ephem
,
sun_ephem
,
read_par
)
class
GridSearch
(
BaseSearchClass
):
...
...
pyfstat/make_sfts.py
View file @
5837254c
""" pyfstat tools to generate sfts """
from
__future__
import
division
,
absolute_import
,
print_function
import
numpy
as
np
import
logging
...
...
@@ -9,8 +10,8 @@ import pkgutil
import
lal
import
lalpulsar
from
core
import
BaseSearchClass
,
tqdm
,
args
import
helper_functions
from
pyfstat.
core
import
BaseSearchClass
,
tqdm
,
args
import
pyfstat.helper_functions
as
helper_functions
earth_ephem
,
sun_ephem
=
helper_functions
.
set_up_ephemeris_configuration
()
...
...
pyfstat/mcmc_based_searches.py
View file @
5837254c
""" Searches using MCMC-based methods """
from
__future__
import
division
,
absolute_import
,
print_function
import
sys
import
os
...
...
@@ -14,11 +15,10 @@ import emcee
import
corner
import
dill
as
pickle
import
core
from
core
import
tqdm
,
args
,
earth_ephem
,
sun_ephem
,
read_par
from
optimal_setup_functions
import
get_V_estimate
from
optimal_setup_functions
import
get_optimal_setup
import
helper_functions
import
pyfstat.core
as
core
from
pyfstat.core
import
tqdm
,
args
,
earth_ephem
,
sun_ephem
,
read_par
from
pyfstat.optimal_setup_functions
import
get_V_estimate
,
get_optimal_setup
import
pyfstat.helper_functions
as
helper_functions
class
MCMCSearch
(
core
.
BaseSearchClass
):
...
...
pyfstat/optimal_setup_functions.py
View file @
5837254c
...
...
@@ -4,13 +4,14 @@ Provides functions to aid in calculating the optimal setup based on the metric
volume estimates.
"""
from
__future__
import
division
,
absolute_import
,
print_function
import
logging
import
numpy
as
np
import
scipy.optimize
import
lal
import
lalpulsar
import
helper_functions
import
pyfstat.helper_functions
as
helper_functions
def
get_optimal_setup
(
...
...
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