From 6bd52e611451f1ce0c6cb4803ac0d310f0f74d0e Mon Sep 17 00:00:00 2001 From: jaimerzp Date: Thu, 26 Dec 2024 12:55:26 +0100 Subject: [PATCH] w_type --- src/tracers.jl | 36 ++++++++++++++++++------------------ test/test_output.npz | Bin 69358 -> 69358 bytes 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/tracers.jl b/src/tracers.jl index 2504134..0bf332e 100755 --- a/src/tracers.jl +++ b/src/tracers.jl @@ -70,7 +70,8 @@ WeakLensingTracer(cosmo::Cosmology, z, nz; chi = cosmo.chi(z) # Compute kernels w_itg(chii) = @.(nz*(1-chii/chi)) - w_arr = zeros(cosmo_type, res) + w_type = typeof(integrate(z[2:res], w_itg(chi[2])[2:res], SimpsonEven())) + w_arr = zeros(w_type, res) @inbounds for i in 1:res-3 w_arr[i] = integrate(z[i:res], w_itg(chi[i])[i:res], SimpsonEven()) end @@ -81,7 +82,7 @@ WeakLensingTracer(cosmo::Cosmology, z, nz; w_arr = @. w_arr * chi * lens_prefac * (1+z) / nz_norm # IA correction hz = Hmpc(cosmo, z) - As = @. A_IA*((1 + z)/1.62)^alpha_IA * (0.0134 * cosmo.cpar.Ωm / cosmo.Dz(z)) + As = get_IA(cosmo, z, A_IA, alpha_IA) corr = @. As * (nz * hz / nz_norm) w_arr_ia = @. w_arr - corr # Interpolate @@ -91,6 +92,21 @@ WeakLensingTracer(cosmo::Cosmology, z, nz; WeakLensingTracer(wint, F) end +""" + get_IA(cosmo::Cosmology, zs, IA_params) +CMB lensing tracer structure. +Arguments: +- `cosmo::Cosmology` : cosmology structure. +- `zs::Vector{Dual}` : redshift array. +- `A_IA::Dual` : Intrinsic aligment amplitud. +- `alpha_IA::Dual` : Intrinsic aligment slope. +Returns: +- `IA_corr::Vector{Dual}` : Intrinsic aligment correction to radial kernel. +""" +function get_IA(cosmo::Cosmology, zs, A_IA, alpha_IA) + return @. A_IA*((1 + zs)/1.62)^alpha_IA * (0.0134 * cosmo.cpar.Ωm / cosmo.Dz(zs)) +end + """ CMBLensingTracer(warr, chis, wint, lpre) CMB lensing tracer structure. @@ -128,22 +144,6 @@ CMBLensingTracer(cosmo::Cosmology; res=350) = begin CMBLensingTracer(wint, F) end -""" - get_IA(cosmo::Cosmology, zs, IA_params) -CMB lensing tracer structure. -Arguments: -- `cosmo::Cosmology` : cosmology structure. -- `zs::Vector{Dual}` : redshift array. -- `IA_params::Vector{Dual}` : Intrinsic aligment parameters. -Returns: -- `IA_corr::Vector{Dual}` : Intrinsic aligment correction to radial kernel. -""" -function get_IA(cosmo::Cosmology, zs, IA_params) - A_IA = IA_params[1] - alpha_IA = IA_params[2] - return @. A_IA*((1 + zs)/1.62)^alpha_IA * (0.0134 * cosmo.cpar.Ωm / cosmo.Dz(zs)) -end - function nz_interpolate(z, nz, res; mode="linear") if mode!="none" if mode=="linear" diff --git a/test/test_output.npz b/test/test_output.npz index b99ebc48e671daac05881286747637b536e7e09b..b96378cf7084f00a5534a93cdfed3a996d9dd67a 100644 GIT binary patch delta 1887 zcmXw3YfMyE5O&zREDO6^D+=Wer2^7z2oRB{JfwhBt4(VYv85`l+7?CpflXtorD!Bn zBHSz|P{Bt^(E6b438(~tg(3yT3KeYA_=qOPM8w#J7}!_uojL5EnLFn@Gv9nOXJ?wF znP$nj@jZ>SbdmadvZJZPH~<>O$`jC}T3+Tc0A7l-d3ya<1#(BXFJC9MBZRxO{p8qm zHgXQ@uacAPGp@($%a-+EM84y98Ux?>3v7Bo7oE%owqnKRpjIpt>ihX6d24bA-x++8 z5c<$_i0Bk{Ti7Z5mclJ)PlTUEn;&ro?Q{fXTDR-dztl|f=+Gwa6In=&)IGh=j9w;pa%B60Te4%I~&xl5G@o5#o+lqgulYLuz!?5|-Ek)1dIIBP3aHvv)k?N7M zpXGOM2eKC)py!SsnkYr%Vbp-9AED&3_UK8h+IE!0DXeb58jq{%i2D9xq+(<(O}4*Q z@T|B*vIVshtG;%ct6bTEli{(}7D{oWlaPD6NbsP`^xZG)7gxT+noq6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