Пример #1
0
def by_pts(filename):
    """Returns by points to be plotted."""
    q = chan(filename)
    red = {"reduce_by_factor": 10}
    CHAINS = q.get_chains("by", **red)  # dictionary of chains and redshifts
    chains = 1e3*CHAINS["by"]           # values only
    bf = q.get_best_fit("by", chains=CHAINS, **red)
    z, by = np.hstack((bf["z"])), 1e3*bf["by"].T
    return z, by, chains
Пример #2
0
    "Fiducial", "NILC", "Fixed $w_z$", "Tinker 2010",
    r"$\langle N_s \rangle$ independent"
    "tSZ-masked"
]
colours = ["k", "grey", "r", "brown", "orange"]
col = [copper(i) for i in np.linspace(0, 1, len(sci))]
fmts = ["o", "o", "v", "s", "*", "d"]

p = ParamRun(param_yml[0])
#temp = [chan(paryml, diff=True, error_type="hpercentile", chains=False, b_hydro=0.5*np.ones([1,6]))
#        for paryml in param_yml]
#pars = [t[0] for t in temp]
#data = np.array([[p["b_hydro"] for p in par] for par in pars])
#data = [d.T for d in data]
print("HI")
BF = [chan(fname).get_best_fit("b_hydro") for fname in param_yml]
print("Best fits OK")

widths = chan(param_yml[0]).get_best_fit("width")
widths = np.hstack((widths["width"][:, 0]))
dz, dN = [[] for i in range(2)]
i = 0
for g in p.get("maps"):
    if g["type"] == "g":
        w = widths[i]
        w = w if type(w) is np.float64 else w[0]  # for fixed w
        zz, NN = get_dndz(g["dndz"], w)
        dz.append(zz)
        dN.append(NN)
        i += 1  # g-counter
Пример #3
0
    lmarr = np.linspace(8., 16., nmass)
    marr = 10.**lmarr
    Dm = delta / ccl.omega_x(cosmo, a, "matter")  # CCL uses Delta_m
    mfunc = ccl.massfunc(cosmo, marr, a, Dm)
    bh = ccl.halo_bias(cosmo, marr, a, Dm)
    et = np.array(
        [integrated_profile(get_battaglia(m, z, delta), n_r) for m in marr])

    return itg.simps(et * bh * mfunc, x=lmarr)


fname_params = "params_wnarrow.yml"
p = ParamRun(fname_params)
cosmo = p.get_cosmo()

q = chan(fname_params)
red = {"reduce_by_factor": 10}
CHAINS = q.get_chains("by", **red)  # dictionary of chains and redshifts
chains = 1e3 * CHAINS["by"]  # values only
bf = q.get_best_fit("by", chains=CHAINS, **red)
z, by = np.hstack((bf["z"])), 1e3 * bf["by"].T

# DES data
DESx = np.array([0.15, 0.24, 0.2495, 0.383, 0.393, 0.526, 0.536, 0.678, 0.688])
DESy = 1e-1 * np.array([1.5, 1.51, 0.91, 2.46, 2.55, 3.85, 3.08, 2.61, 2.25])
DESsy_min = 1e-1 * np.array(
    [1.275, 0.940, 0.2587, 1.88, 2.092, 2.961, 2.377, 1.442, 1.284])
DESsy_max = 1e-1 * np.array(
    [1.726, 2.029, 1.593, 3.039, 2.991, 4.628, 3.620, 3.971, 2.994])
DESsy = np.vstack((DESy - DESsy_min, DESsy_max - DESy))
DES = np.vstack((DESx, DESy, DESsy))