diff --git a/examples/follow_up.py b/examples/follow_up.py index d79b9a66068a8920a76478c113a902f442d1006a..675c2e0fae6e8cf7e25993b27e5de6a230bc81c9 100644 --- a/examples/follow_up.py +++ b/examples/follow_up.py @@ -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() diff --git a/examples/fully_coherent_search_using_MCMC.py b/examples/fully_coherent_search_using_MCMC.py index 254f79106051b8c1bd219e14a08489246553ff67..353ac617f0978f6169255c615e6cbd38a11bf65d 100644 --- a/examples/fully_coherent_search_using_MCMC.py +++ b/examples/fully_coherent_search_using_MCMC.py @@ -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() diff --git a/pyfstat/core.py b/pyfstat/core.py index 2bf275a9c96b2f8f700c062fd0ea5f4623611a21..9249248caeb106b13df9fa91d90e534c3578078f 100755 --- a/pyfstat/core.py +++ b/pyfstat/core.py @@ -1,8 +1,11 @@ """ 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: diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py index 2974c1bf73da7bf3b826927772d016e5c5bec706..dece311593262228a37679dc13a2548623567838 100644 --- a/pyfstat/grid_based_searches.py +++ b/pyfstat/grid_based_searches.py @@ -1,4 +1,5 @@ """ 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): diff --git a/pyfstat/make_sfts.py b/pyfstat/make_sfts.py index 84c6e3ada4269f544ec9167163a26cb8e4a136b0..ea3028a712909a176bc63796e2189b904bc2375c 100644 --- a/pyfstat/make_sfts.py +++ b/pyfstat/make_sfts.py @@ -1,4 +1,5 @@ """ 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() diff --git a/pyfstat/mcmc_based_searches.py b/pyfstat/mcmc_based_searches.py index fddf77f5da64de117ac3a5285df7a7e08b11c675..e2836b1a7e8fff8cedef802336371d2c2a7f0c44 100644 --- a/pyfstat/mcmc_based_searches.py +++ b/pyfstat/mcmc_based_searches.py @@ -1,4 +1,5 @@ """ 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): diff --git a/pyfstat/optimal_setup_functions.py b/pyfstat/optimal_setup_functions.py index 543fed89da650d0401ff7735241a4b122eac5f4f..25017ce1b42ae3afd79b8c29ae69caa5b2e42f04 100644 --- a/pyfstat/optimal_setup_functions.py +++ b/pyfstat/optimal_setup_functions.py @@ -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(