Commit 03a4bddd authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Clean up of the earth/sun ephemeris handling

- Provide a function in the BaseSearchClass to read in the ephemeris
  files
- Some clean up of docstrings
parent df586f0a
...@@ -5,7 +5,6 @@ import os ...@@ -5,7 +5,6 @@ import os
import logging import logging
import copy import copy
import glob import glob
import numpy as np import numpy as np
import scipy.special import scipy.special
...@@ -27,15 +26,14 @@ else: ...@@ -27,15 +26,14 @@ else:
helper_functions.set_up_matplotlib_defaults() helper_functions.set_up_matplotlib_defaults()
args, tqdm = helper_functions.set_up_command_line_arguments() args, tqdm = helper_functions.set_up_command_line_arguments()
earth_ephem, sun_ephem = helper_functions.set_up_ephemeris_configuration()
detector_colors = {'h1': 'C0', 'l1': 'C1'} detector_colors = {'h1': 'C0', 'l1': 'C1'}
class Bunch(object): class Bunch(object):
""" Turns dictionary into object with attribute-style access """ Turns dictionary into object with attribute-style access
Parameter Parameters
--------- ----------
dict dict
Input dictionary Input dictionary
...@@ -178,18 +176,7 @@ def predict_fstat(h0, cosi, psi, Alpha, Delta, Freq, sftfilepattern, ...@@ -178,18 +176,7 @@ def predict_fstat(h0, cosi, psi, Alpha, Delta, Freq, sftfilepattern,
class BaseSearchClass(object): class BaseSearchClass(object):
""" The base search class providing parent methods to other searches """ The base search class providing parent methods to other searches """
Attributes
----------
earth_ephem_default, sun_ephem_default : str
Paths to the earth and sun ephemeris files to use if not specified
elsewhere
"""
earth_ephem_default = earth_ephem
sun_ephem_default = sun_ephem
def _add_log_file(self): def _add_log_file(self):
""" Log output to a file, requires class to have outdir and label """ """ Log output to a file, requires class to have outdir and label """
...@@ -306,19 +293,37 @@ class BaseSearchClass(object): ...@@ -306,19 +293,37 @@ class BaseSearchClass(object):
raise IOError('No sfts found matching {}'.format( raise IOError('No sfts found matching {}'.format(
self.sftfilepattern)) self.sftfilepattern))
def set_ephemeris_files(self, earth_ephem=None, sun_ephem=None):
""" Set the ephemeris files to use for the Earth and Sun
class ComputeFstat(object): Parameters
""" Base class providing interface to `lalpulsar.ComputeFstat` """ ----------
earth_ephem, sun_ephem: str
Paths of the two files containing positions of Earth and Sun,
respectively at evenly spaced times, as passed to CreateFstatInput
earth_ephem_default = earth_ephem Note: If not manually set, default values in ~/.pyfstat are used
sun_ephem_default = sun_ephem
"""
earth_ephem_default, sun_ephem_default = (
helper_functions.get_ephemeris_files())
if earth_ephem is None:
self.earth_ephem = earth_ephem_default
if sun_ephem is None:
self.sun_ephem = sun_ephem_default
class ComputeFstat(BaseSearchClass):
""" Base class providing interface to `lalpulsar.ComputeFstat` """
@helper_functions.initializer @helper_functions.initializer
def __init__(self, tref, sftfilepattern=None, minStartTime=None, def __init__(self, tref, sftfilepattern=None, minStartTime=None,
maxStartTime=None, binary=False, transient=True, BSGL=False, maxStartTime=None, binary=False, transient=True, BSGL=False,
detectors=None, minCoverFreq=None, maxCoverFreq=None, detectors=None, minCoverFreq=None, maxCoverFreq=None,
earth_ephem=None, sun_ephem=None, injectSources=None, injectSources=None, injectSqrtSX=None, assumeSqrtSX=None,
injectSqrtSX=None, assumeSqrtSX=None, SSBprec=None): SSBprec=None):
""" """
Parameters Parameters
---------- ----------
...@@ -343,10 +348,6 @@ class ComputeFstat(object): ...@@ -343,10 +348,6 @@ class ComputeFstat(object):
The min and max cover frequency passed to CreateFstatInput, if The min and max cover frequency passed to CreateFstatInput, if
either is None the range of frequencies in the SFT less 1Hz is either is None the range of frequencies in the SFT less 1Hz is
used. used.
earth_ephem, sun_ephem : str
Paths of the two files containing positions of Earth and Sun,
respectively at evenly spaced times, as passed to CreateFstatInput.
If None defaults will be used.
injectSources : dict or str injectSources : dict or str
Either a dictionary of the values to inject, or a string pointing Either a dictionary of the values to inject, or a string pointing
to the .cff file to inject to the .cff file to inject
...@@ -362,11 +363,7 @@ class ComputeFstat(object): ...@@ -362,11 +363,7 @@ class ComputeFstat(object):
""" """
if earth_ephem is None: self.set_ephemeris_files()
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
self.init_computefstatistic_single_point() self.init_computefstatistic_single_point()
def _get_SFTCatalog(self): def _get_SFTCatalog(self):
...@@ -827,15 +824,15 @@ class ComputeFstat(object): ...@@ -827,15 +824,15 @@ class ComputeFstat(object):
return ax return ax
class SemiCoherentSearch(BaseSearchClass, ComputeFstat): class SemiCoherentSearch(ComputeFstat):
""" A semi-coherent search """ """ A semi-coherent search """
@helper_functions.initializer @helper_functions.initializer
def __init__(self, label, outdir, tref, nsegs=None, sftfilepattern=None, def __init__(self, label, outdir, tref, nsegs=None, sftfilepattern=None,
binary=False, BSGL=False, minStartTime=None, binary=False, BSGL=False, minStartTime=None,
maxStartTime=None, minCoverFreq=None, maxCoverFreq=None, maxStartTime=None, minCoverFreq=None, maxCoverFreq=None,
detectors=None, earth_ephem=None, sun_ephem=None, detectors=None, injectSources=None, assumeSqrtSX=None,
injectSources=None, assumeSqrtSX=None, SSBprec=None): SSBprec=None):
""" """
Parameters Parameters
---------- ----------
...@@ -853,10 +850,7 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -853,10 +850,7 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
""" """
self.fs_file_name = "{}/{}_FS.dat".format(self.outdir, self.label) self.fs_file_name = "{}/{}_FS.dat".format(self.outdir, self.label)
if self.earth_ephem is None: self.set_ephemeris_files()
self.earth_ephem = self.earth_ephem_default
if self.sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
self.transient = True self.transient = True
self.init_computefstatistic_single_point() self.init_computefstatistic_single_point()
self.init_semicoherent_parameters() self.init_semicoherent_parameters()
...@@ -957,7 +951,7 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -957,7 +951,7 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
return d_detStat return d_detStat
class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat): class SemiCoherentGlitchSearch(ComputeFstat):
""" A semi-coherent glitch search """ A semi-coherent glitch search
This implements a basic `semi-coherent glitch F-stat in which the data This implements a basic `semi-coherent glitch F-stat in which the data
...@@ -970,8 +964,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat): ...@@ -970,8 +964,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat):
def __init__(self, label, outdir, tref, minStartTime, maxStartTime, def __init__(self, label, outdir, tref, minStartTime, maxStartTime,
nglitch=0, sftfilepattern=None, theta0_idx=0, BSGL=False, nglitch=0, sftfilepattern=None, theta0_idx=0, BSGL=False,
minCoverFreq=None, maxCoverFreq=None, assumeSqrtSX=None, minCoverFreq=None, maxCoverFreq=None, assumeSqrtSX=None,
detectors=None, earth_ephem=None, sun_ephem=None, detectors=None, SSBprec=None, injectSources=None):
SSBprec=None, injectSources=None):
""" """
Parameters Parameters
---------- ----------
...@@ -994,10 +987,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat): ...@@ -994,10 +987,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat):
""" """
self.fs_file_name = "{}/{}_FS.dat".format(self.outdir, self.label) self.fs_file_name = "{}/{}_FS.dat".format(self.outdir, self.label)
if self.earth_ephem is None: self.set_ephemeris_files()
self.earth_ephem = self.earth_ephem_default
if self.sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
self.transient = True self.transient = True
self.binary = False self.binary = False
self.init_computefstatistic_single_point() self.init_computefstatistic_single_point()
...@@ -1017,7 +1007,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat): ...@@ -1017,7 +1007,7 @@ class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat):
np.array([delta_phi, delta_F0s, delta_F1s, delta_F2]).T) np.array([delta_phi, delta_F0s, delta_F1s, delta_F2]).T)
thetas = self._calculate_thetas(theta, delta_thetas, tboundaries, thetas = self._calculate_thetas(theta, delta_thetas, tboundaries,
theta0_idx=self.theta0_idx) theta0_idx=self.theta0_idx)
twoFSum = 0 twoFSum = 0
for i, theta_i_at_tref in enumerate(thetas): for i, theta_i_at_tref in enumerate(thetas):
......
...@@ -13,7 +13,7 @@ import matplotlib.pyplot as plt ...@@ -13,7 +13,7 @@ import matplotlib.pyplot as plt
import pyfstat.helper_functions as helper_functions import pyfstat.helper_functions as helper_functions
from pyfstat.core import (BaseSearchClass, ComputeFstat, from pyfstat.core import (BaseSearchClass, ComputeFstat,
SemiCoherentGlitchSearch, SemiCoherentSearch, tqdm, SemiCoherentGlitchSearch, SemiCoherentSearch, tqdm,
args, earth_ephem, sun_ephem, read_par) args, read_par)
class GridSearch(BaseSearchClass): class GridSearch(BaseSearchClass):
...@@ -22,9 +22,8 @@ class GridSearch(BaseSearchClass): ...@@ -22,9 +22,8 @@ class GridSearch(BaseSearchClass):
def __init__(self, label, outdir, sftfilepattern, F0s=[0], F1s=[0], F2s=[0], def __init__(self, label, outdir, sftfilepattern, F0s=[0], F1s=[0], F2s=[0],
Alphas=[0], Deltas=[0], tref=None, minStartTime=None, Alphas=[0], Deltas=[0], tref=None, minStartTime=None,
maxStartTime=None, nsegs=1, BSGL=False, minCoverFreq=None, maxStartTime=None, nsegs=1, BSGL=False, minCoverFreq=None,
maxCoverFreq=None, earth_ephem=None, sun_ephem=None, maxCoverFreq=None, detectors=None, SSBprec=None,
detectors=None, SSBprec=None, injectSources=None, injectSources=None, input_arrays=False, assumeSqrtSX=None):
input_arrays=False, assumeSqrtSX=None):
""" """
Parameters Parameters
---------- ----------
...@@ -45,11 +44,6 @@ class GridSearch(BaseSearchClass): ...@@ -45,11 +44,6 @@ class GridSearch(BaseSearchClass):
For all other parameters, see `pyfstat.ComputeFStat` for details For all other parameters, see `pyfstat.ComputeFStat` for details
""" """
if earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
os.mkdir(outdir) os.mkdir(outdir)
self.set_out_file() self.set_out_file()
...@@ -61,7 +55,6 @@ class GridSearch(BaseSearchClass): ...@@ -61,7 +55,6 @@ class GridSearch(BaseSearchClass):
self.search = ComputeFstat( self.search = ComputeFstat(
tref=self.tref, sftfilepattern=self.sftfilepattern, tref=self.tref, sftfilepattern=self.sftfilepattern,
minCoverFreq=self.minCoverFreq, maxCoverFreq=self.maxCoverFreq, minCoverFreq=self.minCoverFreq, maxCoverFreq=self.maxCoverFreq,
earth_ephem=self.earth_ephem, sun_ephem=self.sun_ephem,
detectors=self.detectors, transient=False, detectors=self.detectors, transient=False,
minStartTime=self.minStartTime, maxStartTime=self.maxStartTime, minStartTime=self.minStartTime, maxStartTime=self.maxStartTime,
BSGL=self.BSGL, SSBprec=self.SSBprec, BSGL=self.BSGL, SSBprec=self.SSBprec,
...@@ -75,7 +68,6 @@ class GridSearch(BaseSearchClass): ...@@ -75,7 +68,6 @@ class GridSearch(BaseSearchClass):
BSGL=self.BSGL, minStartTime=self.minStartTime, BSGL=self.BSGL, minStartTime=self.minStartTime,
maxStartTime=self.maxStartTime, minCoverFreq=self.minCoverFreq, maxStartTime=self.maxStartTime, minCoverFreq=self.minCoverFreq,
maxCoverFreq=self.maxCoverFreq, detectors=self.detectors, maxCoverFreq=self.maxCoverFreq, detectors=self.detectors,
earth_ephem=self.earth_ephem, sun_ephem=self.sun_ephem,
injectSources=self.injectSources) injectSources=self.injectSources)
def cut_out_tstart_tend(*vals): def cut_out_tstart_tend(*vals):
...@@ -313,7 +305,7 @@ class GridGlitchSearch(GridSearch): ...@@ -313,7 +305,7 @@ class GridGlitchSearch(GridSearch):
F1s=[0], F2s=[0], delta_F0s=[0], delta_F1s=[0], tglitchs=None, F1s=[0], F2s=[0], delta_F0s=[0], delta_F1s=[0], tglitchs=None,
Alphas=[0], Deltas=[0], tref=None, minStartTime=None, Alphas=[0], Deltas=[0], tref=None, minStartTime=None,
maxStartTime=None, minCoverFreq=None, maxCoverFreq=None, maxStartTime=None, minCoverFreq=None, maxCoverFreq=None,
write_after=1000, earth_ephem=None, sun_ephem=None): write_after=1000):
""" """
Parameters Parameters
...@@ -333,16 +325,11 @@ class GridGlitchSearch(GridSearch): ...@@ -333,16 +325,11 @@ class GridGlitchSearch(GridSearch):
""" """
if tglitchs is None: if tglitchs is None:
self.tglitchs = [self.maxStartTime] self.tglitchs = [self.maxStartTime]
if earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
self.search = SemiCoherentGlitchSearch( self.search = SemiCoherentGlitchSearch(
label=label, outdir=outdir, sftfilepattern=self.sftfilepattern, label=label, outdir=outdir, sftfilepattern=self.sftfilepattern,
tref=tref, minStartTime=minStartTime, maxStartTime=maxStartTime, tref=tref, minStartTime=minStartTime, maxStartTime=maxStartTime,
minCoverFreq=minCoverFreq, maxCoverFreq=maxCoverFreq, minCoverFreq=minCoverFreq, maxCoverFreq=maxCoverFreq,
earth_ephem=self.earth_ephem, sun_ephem=self.sun_ephem,
BSGL=self.BSGL) BSGL=self.BSGL)
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
...@@ -372,8 +359,7 @@ class FrequencySlidingWindow(GridSearch): ...@@ -372,8 +359,7 @@ class FrequencySlidingWindow(GridSearch):
Alpha, Delta, tref, minStartTime=None, Alpha, Delta, tref, minStartTime=None,
maxStartTime=None, window_size=10*86400, window_delta=86400, maxStartTime=None, window_size=10*86400, window_delta=86400,
BSGL=False, minCoverFreq=None, maxCoverFreq=None, BSGL=False, minCoverFreq=None, maxCoverFreq=None,
earth_ephem=None, sun_ephem=None, detectors=None, detectors=None, SSBprec=None, injectSources=None):
SSBprec=None, injectSources=None):
""" """
Parameters Parameters
---------- ----------
...@@ -392,11 +378,6 @@ class FrequencySlidingWindow(GridSearch): ...@@ -392,11 +378,6 @@ class FrequencySlidingWindow(GridSearch):
For all other parameters, see `pyfstat.ComputeFStat` for details For all other parameters, see `pyfstat.ComputeFStat` for details
""" """
if earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
os.mkdir(outdir) os.mkdir(outdir)
self.set_out_file() self.set_out_file()
...@@ -411,7 +392,6 @@ class FrequencySlidingWindow(GridSearch): ...@@ -411,7 +392,6 @@ class FrequencySlidingWindow(GridSearch):
self.search = ComputeFstat( self.search = ComputeFstat(
tref=self.tref, sftfilepattern=self.sftfilepattern, tref=self.tref, sftfilepattern=self.sftfilepattern,
minCoverFreq=self.minCoverFreq, maxCoverFreq=self.maxCoverFreq, minCoverFreq=self.minCoverFreq, maxCoverFreq=self.maxCoverFreq,
earth_ephem=self.earth_ephem, sun_ephem=self.sun_ephem,
detectors=self.detectors, transient=True, detectors=self.detectors, transient=True,
minStartTime=self.minStartTime, maxStartTime=self.maxStartTime, minStartTime=self.minStartTime, maxStartTime=self.maxStartTime,
BSGL=self.BSGL, SSBprec=self.SSBprec, BSGL=self.BSGL, SSBprec=self.SSBprec,
...@@ -487,8 +467,7 @@ class DMoff_NO_SPIN(GridSearch): ...@@ -487,8 +467,7 @@ class DMoff_NO_SPIN(GridSearch):
@helper_functions.initializer @helper_functions.initializer
def __init__(self, par, label, outdir, sftfilepattern, minStartTime=None, def __init__(self, par, label, outdir, sftfilepattern, minStartTime=None,
maxStartTime=None, minCoverFreq=None, maxCoverFreq=None, maxStartTime=None, minCoverFreq=None, maxCoverFreq=None,
earth_ephem=None, sun_ephem=None, detectors=None, detectors=None, injectSources=None, assumeSqrtSX=None):
injectSources=None, assumeSqrtSX=None):
""" """
Parameters Parameters
---------- ----------
...@@ -506,11 +485,6 @@ class DMoff_NO_SPIN(GridSearch): ...@@ -506,11 +485,6 @@ class DMoff_NO_SPIN(GridSearch):
For all other parameters, see `pyfstat.ComputeFStat` for details For all other parameters, see `pyfstat.ComputeFStat` for details
""" """
if earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
os.mkdir(outdir) os.mkdir(outdir)
......
...@@ -80,7 +80,7 @@ def set_up_command_line_arguments(): ...@@ -80,7 +80,7 @@ def set_up_command_line_arguments():
return args, tqdm return args, tqdm
def set_up_ephemeris_configuration(): def get_ephemeris_files():
""" Returns the earth_ephem and sun_ephem """ """ Returns the earth_ephem and sun_ephem """
config_file = os.path.expanduser('~')+'/.pyfstat.conf' config_file = os.path.expanduser('~')+'/.pyfstat.conf'
if os.path.isfile(config_file): if os.path.isfile(config_file):
......
...@@ -13,8 +13,6 @@ import lalpulsar ...@@ -13,8 +13,6 @@ import lalpulsar
from pyfstat.core import BaseSearchClass, tqdm, args from pyfstat.core import BaseSearchClass, tqdm, args
import pyfstat.helper_functions as helper_functions import pyfstat.helper_functions as helper_functions
earth_ephem, sun_ephem = helper_functions.set_up_ephemeris_configuration()
class KeyboardInterruptError(Exception): class KeyboardInterruptError(Exception):
pass pass
...@@ -49,6 +47,7 @@ class Writer(BaseSearchClass): ...@@ -49,6 +47,7 @@ class Writer(BaseSearchClass):
see `lalapps_Makefakedata_v5 --help` for help with the other paramaters see `lalapps_Makefakedata_v5 --help` for help with the other paramaters
""" """
self.set_ephemeris_files()
self.tstart = int(tstart) self.tstart = int(tstart)
self.duration = int(duration) self.duration = int(duration)
...@@ -372,15 +371,11 @@ class GlitchWriter(Writer): ...@@ -372,15 +371,11 @@ class GlitchWriter(Writer):
class FrequencyModulatedArtifactWriter(Writer): class FrequencyModulatedArtifactWriter(Writer):
""" Instance object for generating SFTs containing artifacts """ """ Instance object for generating SFTs containing artifacts """
earth_ephem_default = earth_ephem
sun_ephem_default = sun_ephem
@helper_functions.initializer @helper_functions.initializer
def __init__(self, label, outdir=".", tstart=700000000, def __init__(self, label, outdir=".", tstart=700000000,
data_duration=86400, F0=30, F1=0, tref=None, h0=10, Tsft=1800, data_duration=86400, F0=30, F1=0, tref=None, h0=10, Tsft=1800,
sqrtSX=1, Band=4, Pmod=lal.DAYSID_SI, Pmod_phi=0, Pmod_amp=1, sqrtSX=1, Band=4, Pmod=lal.DAYSID_SI, Pmod_phi=0, Pmod_amp=1,
Alpha=None, Delta=None, IFO='H1', earth_ephem=None, Alpha=None, Delta=None, IFO='H1'):
sun_ephem=None):
""" """
Parameters Parameters
---------- ----------
...@@ -399,6 +394,7 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -399,6 +394,7 @@ class FrequencyModulatedArtifactWriter(Writer):
see `lalapps_Makefakedata_v4 --help` for help with the other paramaters see `lalapps_Makefakedata_v4 --help` for help with the other paramaters
""" """
self.set_ephemeris_files()
self.tstart = int(tstart) self.tstart = int(tstart)
self.data_duration = int(data_duration) self.data_duration = int(data_duration)
...@@ -414,11 +410,6 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -414,11 +410,6 @@ class FrequencyModulatedArtifactWriter(Writer):
self.cosi = 0 self.cosi = 0
self.Fmax = F0 self.Fmax = F0
if self.earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if self.sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
if Alpha is not None and Delta is not None: if Alpha is not None and Delta is not None:
self.n = np.array([np.cos(Alpha)*np.cos(Delta), self.n = np.array([np.cos(Alpha)*np.cos(Delta),
np.sin(Alpha)*np.cos(Delta), np.sin(Alpha)*np.cos(Delta),
......
...@@ -16,8 +16,8 @@ import corner ...@@ -16,8 +16,8 @@ import corner
import dill as pickle import dill as pickle
import pyfstat.core as core import pyfstat.core as core
from pyfstat.core import tqdm, args, earth_ephem, sun_ephem, read_par from pyfstat.core import tqdm, args, read_par
from pyfstat.optimal_setup_functions import get_Nstar_estimate, get_optimal_setup import pyfstat.optimal_setup_functions as optimal_setup_functions
import pyfstat.helper_functions as helper_functions import pyfstat.helper_functions as helper_functions
...@@ -33,17 +33,17 @@ class MCMCSearch(core.BaseSearchClass): ...@@ -33,17 +33,17 @@ class MCMCSearch(core.BaseSearchClass):
asini='', period='s', ecc='', tp='', argp='') asini='', period='s', ecc='', tp='', argp='')
rescale_dictionary = {} rescale_dictionary = {}
@helper_functions.initializer @helper_functions.initializer
def __init__(self, label, outdir, theta_prior, tref, minStartTime, def __init__(self, label, outdir, theta_prior, tref, minStartTime,
maxStartTime, sftfilepattern=None, nsteps=[100, 100], maxStartTime, sftfilepattern=None, nsteps=[100, 100],
nwalkers=100, ntemps=1, log10temperature_min=-5, nwalkers=100, ntemps=1, log10temperature_min=-5,
theta_initial=None, scatter_val=1e-10, rhohatmax=1000, theta_initial=None, scatter_val=1e-10, rhohatmax=1000,
binary=False, BSGL=False, minCoverFreq=None, SSBprec=None, binary=False, BSGL=False, minCoverFreq=None, SSBprec=None,
maxCoverFreq=None, detectors=None, earth_ephem=None, maxCoverFreq=None, detectors=None,
sun_ephem=None, injectSources=None, assumeSqrtSX=None): injectSources=None, assumeSqrtSX=None):
""" """
Parameters Parameters
----------
label, outdir: str label, outdir: str
A label and directory to read/write data from/to A label and directory to read/write data from/to
sftfilepattern: str sftfilepattern: str
...@@ -83,10 +83,6 @@ class MCMCSearch(core.BaseSearchClass): ...@@ -83,10 +83,6 @@ class MCMCSearch(core.BaseSearchClass):
minCoverFreq, maxCoverFreq: float minCoverFreq, maxCoverFreq: float
Minimum and maximum instantaneous frequency which will be covered Minimum and maximum instantaneous frequency which will be covered
over the SFT time span as passed to CreateFstatInput over the SFT time span as passed to CreateFstatInput
earth_ephem, sun_ephem: str
Paths of the two files containing positions of Earth and Sun,
respectively at evenly spaced times, as passed to CreateFstatInput
If None defaults defined in BaseSearchClass will be used
""" """
...@@ -108,11 +104,6 @@ class MCMCSearch(core.BaseSearchClass): ...@@ -108,11 +104,6 @@ class MCMCSearch(core.BaseSearchClass):
else: else:
self.betas = None self.betas = None
if earth_ephem is None:
self.earth_ephem = self.earth_ephem_default
if sun_ephem is None:
self.sun_ephem = self.sun_ephem_default
if args.clean and os.path.isfile(self.pickle_path): if args.clean and os.path.isfile(self.pickle_path):
os.rename(self.pickle_path, self.pickle_path+".old") os.rename(self.pickle_path, self.pickle_path+".old")
...@@ -137,7 +128,6 @@ class MCMCSearch(core.BaseSearchClass): ...@@ -137,7 +128,6 @@ class MCMCSearch(core.BaseSearchClass):
self.search = core.ComputeFstat( self.search = core.ComputeFstat(
tref=self.tref, sftfilepattern=self.sftfilepattern,