Commit 5837254c authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds from __future__ imports to an in Python3 compaitibility

parent e4dce426
......@@ -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()
......@@ -48,14 +48,14 @@ theta_prior = {'F0': {'type': 'unif',
ntemps = 1
log10temperature_min = -1
nwalkers = 1000
nsteps = [50, 50]
nwalkers = 100
nsteps = [1000, 1000]
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()
""" 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:
......
""" 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 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()
......
""" 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):
......
......@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment