Example #1
0
 def xi(self, r=0., z1=0.0, R1=8., z2=0.0, R2=8.):
     """return the smoothed two-point correlation function (of two subvolumes of size R1 and R2), r apart
     """
     fac = self.gfratio(z1)*self.gfratio(z2)/(2.*np.power(np.pi, 2.0))
     integrand = lambda q: q*q*top_hat(q, R1)*top_hat(q, R2)*BesselJ(0, q*r)*self.power_spectrumz(q, z=0)
     results = integrate.quad(integrand, 0.0, 20./min(R1, R2))
     return fac*results[0]
Example #2
0
    def xi_camb(self, r=0., z1=0.0, R1=8., z2=0.0, R2=8.):
        """return the smoothed two-point correlation function
        using the non-linear matter spectrum from camb

        make sure to run get_nonlin_power using z=0
        """
        fac = self.gfratio(z1)*self.gfratio(z2)/(2.*np.power(np.pi, 2.0))
        integrand = lambda q: q*q*top_hat(q, R1)*top_hat(q, R2)*BesselJ(0, q*r)*self.camb_power_nonlin(q)
        results = integrate.quad(integrand, 2E-5, 20./min(R1, R2), limit=300)
        return fac*results[0]
Example #3
0
 def sigmaR(self, R):
     """
     compute sigma_R by integrating;
     now use the CAMB power spectrum
     """
     #fac = 1./(2.*np.power(np.pi, 2.0))
     integrand = lambda q: np.power(top_hat(q, R)*self.alpha(q), 2.0)*self.primordial_power(self.A, q, self.k0)/q
     #integrand = lambda q: q*q*np.power(top_hat(q, R), 2.0)*self.camb_power_lin(q)
     results = integrate.quad(integrand, 0.0, 20./R, limit=80)
     return np.sqrt(results[0])
Example #4
0
 def sigma_sq_integrand(self, k, R):
     return k*k/(2.0*np.pi**2.0)*self.power_spectrum0(self.A, k)*top_hat(k,R)**2.0