Exemple #1
0
def check_corr_3dRSD(cosmo):

    # Scale factor
    a = 0.8

    # Cosine of the angle
    mu = 0.7

    # Growth rate divided by galaxy bias
    beta = 0.5

    # Distances (in Mpc)
    s_int = 50
    s = 50.
    s_lst = np.linspace(50, 100, 10)

    # Make sure 3d correlation functions work for valid inputs
    corr1 = ccl.correlation_3dRsd(cosmo, a, s_int, mu, beta)
    corr2 = ccl.correlation_3dRsd(cosmo, a, s, mu, beta)
    corr3 = ccl.correlation_3dRsd(cosmo, a, s_lst, mu, beta)
    assert_(all_finite(corr1))
    assert_(all_finite(corr2))
    assert_(all_finite(corr3))

    corr4 = ccl.correlation_3dRsd_avgmu(cosmo, a, s_int, beta)
    corr5 = ccl.correlation_3dRsd_avgmu(cosmo, a, s, beta)
    corr6 = ccl.correlation_3dRsd_avgmu(cosmo, a, s_lst, beta)
    assert_(all_finite(corr4))
    assert_(all_finite(corr5))
    assert_(all_finite(corr6))

    corr7 = ccl.correlation_multipole(cosmo, a, beta, 0, s_lst)
    corr8 = ccl.correlation_multipole(cosmo, a, beta, 2, s_lst)
    corr9 = ccl.correlation_multipole(cosmo, a, beta, 4, s_lst)
    assert_(all_finite(corr7))
    assert_(all_finite(corr8))
    assert_(all_finite(corr9))

    # Distances (in Mpc)
    pie = 50.
    sig_int = 50
    sig = 50.
    sig_lst = np.linspace(50, 100, 10)

    corr10 = ccl.correlation_pi_sigma(cosmo, a, beta, pie, sig_int)
    corr11 = ccl.correlation_pi_sigma(cosmo, a, beta, pie, sig)
    corr12 = ccl.correlation_pi_sigma(cosmo, a, beta, pie, sig_lst)
    assert_(all_finite(corr10))
    assert_(all_finite(corr11))
    assert_(all_finite(corr12))

    #free spline
    ccl.correlation_spline_free()
Exemple #2
0
def test_correlation_pi_sigma_smoke(sval):
    a = 0.8
    beta = 0.5
    pie = 1
    corr = ccl.correlation_pi_sigma(COSMO, a, beta, pie, sval)
    assert np.all(np.isfinite(corr))
    assert np.shape(corr) == np.shape(sval)