Пример #1
0
    def __init__(self):

        self.NZ = int(step_nz_par.value)
        self.Z  = numpy.zeros((self.NZ))  # redshifts of bin boundaries
        self.R  = numpy.zeros((self.NZ+1))  # rho_de/rho_c in bins

        # see ParamDefs.py for the values of parameters
        if(self.NZ > 0):
            self.Z[0] = step_z0_par.value
            self.R[0] = step_rho0_par.value
            self.R[1] = step_rho1_par.value
        if(self.NZ > 1):
            self.Z[1] = step_z1_par.value
            self.R[2] = step_rho2_par.value
        if(self.NZ > 2):
            self.Z[2] = step_z2_par.value
            self.R[3] = step_rho3_par.value
        if(self.NZ > 3):
            self.Z[3] = step_z3_par.value
            self.R[4] = step_rho4_par.value
        if(self.NZ > 4):
            self.Z[4] = step_z4_par.value
            self.R[5] = step_rho5_par.value

        LCDMCosmology.__init__(self)

        # compute omegak, updated in updateParams
        self.Ok = 0
        self.Ok = 1.-self.RHSquared_a(1.)
        self.setCurvature(self.Ok)
Пример #2
0
 def __init__(self, dz=0.2, zmax=1.0):
     # bunch of parameters:
     self.zbins = np.arange(0, zmax, dz)
     self.Nb = len(self.zbins)
     self.wvals = np.ones(self.Nb) * -1.0
     self.pnames = ["w%i" % i for i in range(self.Nb)]
     LCDMCosmology.__init__(self)
     self.integrateOmega()
Пример #3
0
 def __init__(self):
     # Adding bunch of parameters.
     self.Ok = Ok_par.value
     self.q = q_par.value
     self.za = za_par.value
     self.zb = zb_par.value
     self.wd = wd_par.value
     self.Od = Od_par.value
     LCDMCosmology.__init__(self)
Пример #4
0
    def __init__(self, varyw=True, varyOk=True):
        # two parameters: Om and h

        self.varyw = varyw
        self.varyOk = varyOk

        self.Ok = Ok_par.value
        self.dw0 = dw_par.value

        LCDMCosmology.__init__(self)
Пример #5
0
    def __init__(self, varyw=True, varywa=True, varyOk=True):
        # three parameters: w, wa, Ok

        self.varyw = varyw
        self.varywa = varywa
        self.varyOk = varyOk

        self.Ok = Ok_par.value
        self.w0 = w_par.value
        self.wa = wa_par.value
        LCDMCosmology.__init__(self)
Пример #6
0
 def __init__(self, polyvary=['Om1', 'Om2', 'Ok'], Ok_prior=0.1):
     # Ok, LCDM has Omega_m, we also have Omega_1 and Omega_2
     # and Lambda is then what remains
     ##
     self.Ok = Ok_par.value
     self.Om1 = Om1_par.value
     self.Om2 = Om2_par.value
     self.varyOm1 = 'Om1' in polyvary
     self.varyOm2 = 'Om2' in polyvary
     self.varyOk = 'Ok' in polyvary
     self.Ok_prior = Ok_prior
     LCDMCosmology.__init__(self, mnu=0)
Пример #7
0
    def __init__(self, varyw=True, varyOde=True, userd_DE=True):
        # two parameters: Om and h

        self.userd_DE = userd_DE
        print('userd', userd_DE)

        self.varyw = varyw
        self.varyOde = varyOde

        self.w0 = w_par.value
        self.Ode = Ode_par.value

        self.oC = LCDMCosmology()
        LCDMCosmology.__init__(self)
Пример #8
0
    def __init__(self, varylam=True, varyxfrac=True, xfrac=xfrac_par.value):

        self.varylam = varylam
        self.varyxfrac = varyxfrac

        self.lam = lambda_par.value
        self.xfrac = xfrac

        LCDMCosmology.__init__(self)

        self.logar = np.linspace(0.0, -7.1, 100)
        self.ilogar = self.logar[::-1]

        # force caching
        self.updateParams([])
Пример #9
0
 def freeParameters(self):
     l = LCDMCosmology.freeParameters(self)
     if (self.varySp1): l.append(Sp1_par)
     if (self.varySp2): l.append(Sp2_par)
     if (self.varySp3): l.append(Sp3_par)
     if (self.varySp4): l.append(Sp4_par)
     return l
Пример #10
0
 def freeParameters(self):
     l = LCDMCosmology.freeParameters(self)
     if self.varyOm1: l.append(Om1_par)
     if self.varyOm2: l.append(Om2_par)
     Ok_par.setError(0.7)
     if self.varyOk: l.append(Ok_par)
     return l
Пример #11
0
 def __init__(self):
     obh2 = 0.0227
     Om   = 0.27
     h    = 0.7
     mnu  = 0  # ;# rd=149.77
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     TabulatedBAOLikelihood.__init__(self, "DR11LyaCross", 'data/lyabaocross.scan',
                                     2, fidTheory, 2.36)
Пример #12
0
 def __init__(self):
     obh2 = 0.0224
     Om   = 0.274
     h    = 0.7
     mnu  = 0
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     GaussBAODVLikelihood.__init__(
         self, "DR11LOWZ", 0.32, 1264.0, 25.0, fidTheory)
Пример #13
0
 def __init__(self):
     obh2 = 0.021547
     Om   = 0.31
     h    = 0.67
     mnu  = 0
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     TabulatedBAODVLikelihood.__init__(
         self, "MGS", "data/chidavexi8stavePk5staverec.dat", fidTheory, 0.15)
Пример #14
0
    def updateParams(self, pars):
        LCDMCosmology.updateParams(self, pars)
        self.oC.updateParams(pars)

        for p in pars:
            if p.name == "Ok":
                self.Ok = p.value
                self.setCurvature(self.Ok)
                if (abs(self.Ok) > 1.0):
                    return False
            elif p.name == "mu":
                self.mu = p.value
            elif p.name == "Amp":
                self.Amp = p.value
            elif p.name == "sig":
                self.sig = p.value
        return True
Пример #15
0
 def __init__(self):
     obh2 = 0.02227
     Om   = 0.27
     h    = 0.7
     mnu  = 0
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     GaussBAODVLikelihood.__init__(
         self, "SixdFGS", 0.106, 456.0, 27.0, fidTheory, maxchi2=4)
Пример #16
0
 def updateParams(self, pars):
     ok = LCDMCosmology.updateParams(self, pars)
     if not ok:
         return False
     for p in pars:
         if p.name == "w":
             self.w = p.value
     return True
Пример #17
0
 def freeParameters(self):
     l = []
     if (self.varyCos):
         l += LCDMCosmology.freeParameters(self)
     if (self.varyOk): l.append(Ok_par)
     if (self.varymu): l.append(mu_par)
     if (self.varyAmp): l.append(Amp_par)
     if (self.varysig): l.append(sig_par)
     return l
Пример #18
0
 def freeParameters(self):
     l = LCDMCosmology.freeParameters(self)
     if(self.NZ > 0):
         l.append(step_rho0_par)
         l.append(step_rho1_par)
     if(self.NZ > 1): l.append(step_rho2_par)
     if(self.NZ > 2): l.append(step_rho3_par)
     if(self.NZ > 3): l.append(step_rho4_par)
     if(self.NZ > 4): l.append(step_rho5_par)
     return l
Пример #19
0
 def __init__(self):
     # fiducial cosmology for LOWZ/CMASS data.
     # see Anderson et al, page 28
     obh2 = 0.0224
     Om   = 0.274
     h    = 0.7
     mnu  = 0  # rd=149.28
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     # negative col means the cols is probability and not chi2
     TabulatedBAOLikelihood.__init__(self, "DR11CMASS", 'data/sdss_DR11CMASS_consensus.dat',
                                     -2, fidTheory, 0.57)
Пример #20
0
 def __init__(self):
     # fiducial cosmology for Lya data.
     # Taken from https://github.com/igmhub/picca/blob/master/data/deSainteAgatheetal2019/auto_alone_stdFit/auto_alone_stdFit..ap.at.scan.dat
     # fiducial model -- see Table 2 of Victoria's paper
     obh2 = 0.02222
     h    = 0.6731
     Om   = 0.1426/h**2
     mnu  = 0.06  # rd=147.33
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     TabulatedBAOLikelihood.__init__(self, "DR14LyaAuto", 'data/deSainteAgatheetal2019_ap_at_scan.dat',
                                     2, fidTheory, 2.34, aperp_col=1, apar_col=0, skiprows=1)
Пример #21
0
    def __init__(self):
        # fiducial cosmology for Lya data.
        # see e.g. Busca's email on 12/3/13

        obh2 = 0.0227
        Om   = 0.27
        h    = 0.7
        mnu  = 0.06  # ;# rd=149.77
        fidTheory = LCDMCosmology(obh2, Om, h, mnu)
        # File from 5/16 from Nicolas.
        TabulatedBAOLikelihood.__init__(self, "DR11LyaAuto", 'data/chi2_surface_dr11_baseline_fit.txt',
                                        4, fidTheory, 2.34)
Пример #22
0
 def __init__(self):
     # fiducial cosmology for Lya data.
     # Taken from  https://github.com/igmhub/picca/tree/master/data/Blomqvistetal2019/cross_alone_stdFit
     # fiducial model -- double check
     obh2 = 0.02222
     h    = 0.6731
     Om   = 0.1426/h**2
     mnu  = 0.06  # rd=147.33
     fidTheory = LCDMCosmology(obh2, Om, h, mnu)
     # File from 5/16 from Nicolas.
     TabulatedBAOLikelihood.__init__(self, "DR14LyaCross", 'data/Blomqvistetal2019_ap_at_scan.dat',
                                     2, fidTheory, 2.34, aperp_col=1, apar_col=0, skiprows=1)
Пример #23
0
    def __init__(self, varymu=True, varyAmp=True, varysig=True, varyCos=True):
        # several parameters:

        # we start with false here...
        varyOk = False
        # this is my "original cosmology" -- outside gaussian not much will change.

        self.varyOk = varyOk
        self.varymu = varymu
        self.varyAmp = varyAmp
        self.varysig = varysig
        self.varyCos = varyCos

        self.Ok = Ok_par.value
        self.mu = mu_par.value
        self.Amp = Amp_par.value
        self.sig = sig_par.value

        # auxiliary self cosmology
        self.oC = LCDMCosmology()
        LCDMCosmology.__init__(self)
Пример #24
0
    def __init__(self, varySp1=True, varySp2=True, varySp3=True, varySp4=True):

        self.varySp1 = varySp1
        self.varySp2 = varySp2
        self.varySp3 = varySp3
        self.varySp4 = varySp4

        self.Sp1 = Sp1_par.value
        self.Sp2 = Sp2_par.value
        self.Sp3 = Sp3_par.value
        self.Sp4 = Sp4_par.value

        # Nodes are equally-spaced in log10(z)
        self.zmin = 0.1  # first-node position
        self.zmax = 2.5  # last-node position
        self.Nnodes = 6  # number of nodes used

        self.lzmin = N.log10(self.zmin)
        self.lzmax = N.log10(self.zmax)

        LCDMCosmology.__init__(self)
Пример #25
0
 def updateParams(self, pars):
     ok = LCDMCosmology.updateParams(self, pars)
     if not ok:
         return False
     for p in pars:
         if p.name == "dw":
             self.dw0 = p.value
         elif p.name == "Ok":
             self.Ok = p.value
             self.setCurvature(self.Ok)
             if (abs(self.Ok) > 1.0):
                 return False
     return True
Пример #26
0
    def updateParams(self, pars):
        ok = LCDMCosmology.updateParams(self, pars)
        if not ok:
            return False
        for p in pars:
            for i in range(self.NZ+1):
                if p.name == "StepR%d" % i:
                    self.R[i] = p.value

        # compute omegak, used in RHSquared_a
        self.Ok = 0
        self.Ok = 1-self.RHSquared_a(1.)
        self.setCurvature(self.Ok)
        return True
Пример #27
0
 def updateParams(self, pars):
     ok = LCDMCosmology.updateParams(self, pars)
     if not ok:
         return False
     for p in pars:
         if p.name == "Sp1":
             self.Sp1 = p.value
         elif p.name == "Sp2":
             self.Sp2 = p.value
         elif p.name == "Sp3":
             self.Sp3 = p.value
         elif p.name == "Sp4":
             self.Sp4 = p.value
     return True
Пример #28
0
 def updateParams(self, pars):
     ok = LCDMCosmology.updateParams(self, pars)
     if not ok:
         return False
     for p in pars:
         if p.name == "q": self.q = p.value
         if p.name == "za": self.za = p.value
         if p.name == "zb": self.zb = p.value
         if p.name == "wd": self.wd = p.value
         if p.name == "Od": self.Od = p.value
         elif p.name == "Ok":
             self.Ok = p.value
             self.setCurvature(self.Ok)
     return True
Пример #29
0
    def updateParams(self, pars):
        ok = LCDMCosmology.updateParams(self, pars)
        if not ok:
            return False
        gotone = False
        for p in pars:
            ## Something's happening here, check it later
            print('**', p.name, self.pnames)
            i = self.pnames.index(p.name)

            if i > 0:
                self.wvals[i] = p.value
                gotone = True
        if gotone:
            self.integrateOmega()
        return True
Пример #30
0
 def updateParams(self, pars):
     ok = LCDMCosmology.updateParams(self, pars)
     if not ok:
         return False
     for p in pars:
         if p.name == "lambda":
             self.lam = p.value
         if p.name == "xfrac":
             self.xfrac = p.value
     self.SolveEq()
     # and updated with relevant rd
     self.setrd(
         self.rd_func_(self.Obh2, self.Ocbh2_early, self.Omnuh2,
                       self.Nnu()))
     assert (abs(self.RHSquared_a(1.0) - 1) < 1e-4)
     return True