Beispiel #1
0
    def __init__(self, path, data, command_line):

        # Standard initialization, reads the .data
        Likelihood.__init__(self, path, data, command_line)

        # Extra needed cosmological paramters
        self.need_cosmo_arguments(data, {
            'output': 'tCl pCl lCl',
            'lensing': 'yes'
        })

        try:
            import pywlik
        except ImportError:
            raise io_mp.MissingLibraryError(
                "You must first activate the binaries from the wmap wrapper." +
                " Please run : \n " +
                "]$ source /path/to/wrapper_wmap/bin/clik_profile.sh\n " +
                "and try again.")

        # try importing the wrapper_wmap
        self.wmaplike = pywlik.wlik(self.large_data_directory, self.ttmin,
                                    self.ttmax, self.temin, self.temax,
                                    self.use_gibbs, self.use_lowlpol)

        # self.cls = np.loadtxt(self.cl_test_file)

        # loglike = self.wmaplike(self.cls)
        # print "got %g expected %g"%(loglike,-845.483)

        self.l_max = max(self.ttmax, self.temax)
        self.need_cosmo_arguments(data, {'l_max_scalars': self.l_max})

        # deal with nuisance parameters
        try:
            self.use_nuisance
        except:
            self.use_nuisance = []
        self.read_contamination_spectra(data)

        pass
Beispiel #2
0
    def __init__(self, path, data, command_line):

        # Standard initialization, reads the .data
        Likelihood.__init__(self, path, data, command_line)

        # Extra needed cosmological paramters
        self.need_cosmo_arguments(
            data, {'output': 'tCl pCl lCl', 'lensing': 'yes'})

        try:
            import pywlik
        except ImportError:
            raise io_mp.MissingLibraryError(
                "You must first activate the binaries from the wmap wrapper." +
                " Please run : \n " +
                "]$ source /path/to/wrapper_wmap/bin/clik_profile.sh\n " +
                "and try again.")

        # try importing the wrapper_wmap
        self.wmaplike = pywlik.wlik(self.large_data_directory, self.ttmin,
                                    self.ttmax, self.temin, self.temax,
                                    self.use_gibbs, self.use_lowlpol)

        # self.cls = np.loadtxt(self.cl_test_file)

        # loglike = self.wmaplike(self.cls)
        # print "got %g expected %g"%(loglike,-845.483)

        self.l_max = max(self.ttmax, self.temax)
        self.need_cosmo_arguments(data, {'l_max_scalars': self.l_max})

        # deal with nuisance parameters
        try:
            self.use_nuisance
        except:
            self.use_nuisance = []
        self.read_contamination_spectra(data)

        pass
Beispiel #3
0
import pywlik
import numpy as nm

datadir = "FILLME"
#datadir = "/path/to/likelihood_v4p1"
ttmin = 2
ttmax = 32
temin = 2
temax = 32
use_gibbs = 0
use_lowlpol = 1

wmaplike = pywlik.wlik(datadir, ttmin, ttmax, temin, temax, use_gibbs,
                       use_lowlpol)

cls = nm.loadtxt("wmap_7_2-32.cltest")

loglike = wmaplike(cls)

print "got %g expected %g" % (loglike, -845.483)
Beispiel #4
0
import pywlik
import numpy as nm

datadir = "FILLME"
#datadir = "/path/to/likelihood_v4p1"
ttmin = 2
ttmax = 32
temin = 2
temax = 32
use_gibbs = 0
use_lowlpol = 1

wmaplike = pywlik.wlik(datadir,ttmin,ttmax,temin,temax,use_gibbs,use_lowlpol)

cls = nm.loadtxt("wmap_7_2-32.cltest")

loglike = wmaplike(cls)

print "got %g expected %g"%(loglike,-845.483)