@@ -35,22 +35,12 @@ function get_params(::AbstractBattagliaTauProfile{T}, M_200c, z) where T
3535 m = M_200c / (1e14 M_sun)
3636 P₀ = 4.e3 * m^ 0.29 * z₁^ (- 0.66 )
3737 α = 0.88 * m^ (- 0.03 ) * z₁^ 0.19
38- β = - 3.83 * m^ 0.04 * z₁^ (- 0.025 )
38+ β = 3.83 * m^ 0.04 * z₁^ (- 0.025 )
3939 xc = 0.5
4040 γ = - 0.2
4141 return (xc= T (xc), α= T (α), β= T (β), γ= T (γ), P₀= T (P₀))
4242end
4343
44- function ρ_crit_comoving_h⁻² (model, z)
45- return (ρ_crit (model, z) ) / (1 + z)^ 3 / model. cosmo. h^ 2
46- end
47-
48- function r200c_comoving (model, M_200c, z)
49- rho_crit = ρ_crit (model, z) / (1 + z)^ 3
50- return cbrt (M_200c/ (4 π/ 3 * rho_crit * 200 ))
51- end
52-
53-
5444# if angular, return the R200 size in radians
5545function object_size (model:: BattagliaTauProfile{T,C} , physical_size, z) where {T,C}
5646 d_A = angular_diameter_dist (model. cosmo, z)
6858# returns a density, which we can check against Msun/Mpc²
6959function rho_2d (model:: AbstractBattagliaTauProfile , r, m200c, z)
7060 par = get_params (model, m200c, z)
71- r200c = R_Δ (model, m200c, z, 200 )
61+ r200c = R_Δ (model, m200c, z, 200 ) # this is physical units
7262 X = r / object_size (model, r200c, z) # either ang/ang or phys/phys
73- rho_crit = ρ_crit_comoving_h⁻² (model, z) # need to sort this out, it's all in comoving...
74- result = par. P₀ * XGPaint. _nfw_profile_los_quadrature (X, par. xc, par. α, par. β, par. γ)
75-
76- return result * rho_crit * (r200c * (1 + z))
63+ rho_crit = ρ_crit (model, z) # this is physical units
64+ rho_fit = par. P₀ * XGPaint. _nfw_profile_los_quadrature (X, par. xc, par. α, par. β, par. γ) # dimensionless _nfw_profile_los_quadrature comes from profiles_y.jl TODO move
65+ return rho_fit * model. f_b * rho_crit * r200c # mistake in battaglia 2016: need f_b to convert from m to gas. note r200c due to integral over X
7766end
7867
7968function ne2d (model:: AbstractBattagliaTauProfile , r, m200c, z)
@@ -83,8 +72,8 @@ function ne2d(model::AbstractBattagliaTauProfile, r, m200c, z)
8372 xH = 0.76
8473 nH_ne = 2 xH / (xH + 1 )
8574 nHe_ne = (1 - xH)/ (2 * (1 + xH))
86- factor = (me + nH_ne* mH + nHe_ne* mHe) / model . cosmo . h ^ 2
87- result = rho_2d (model, r, m200c, z) # (Msun/h ) / (Mpc/h )^2
75+ factor = (me + nH_ne* mH + nHe_ne* mHe)
76+ result = rho_2d (model, r, m200c, z) # (Msun) / (Mpc)^2
8877 return result / factor
8978end
9079
0 commit comments