@@ -46,13 +46,38 @@ function T_vir_calc(𝕡,M,z::T) where T
4646 return T_vir
4747end
4848
49- function rSZ (𝕡, M_200, z, r, showT= true )
49+ function T_mass_calc (𝕡,M,z:: T ; scale_type= " Ty" , sim_type= " combination" ) where T
50+ """
51+ Calculates the temperature for a given halo using https://arxiv.org/pdf/2207.05834.pdf.
52+ """
53+ E_z = 𝕡. cosmo. Ω_m* (1 + z)^ 3 + 𝕡. cosmo. Ω_Λ
54+ par_dict_scale = Dict ([(" Ty" ,[1.426 ,0.566 ,0.024 ]),(" Tm" ,[1.207 ,0.589 ,0.003 ]),(" Tsl" ,[1.196 ,0.641 ,- 0.048 ])])
55+ par_dict_sim = Dict ([(" combination" ,[1.426 ,0.566 ,0.024 ]),(" bahamas" ,[2.690 ,0.323 ,0.023 ]),(" the300" ,[2.294 ,0.350 ,0.013 ]),(" magneticum" ,[2.789 ,0.379 ,0.030 ]),(" tng" ,[2.154 ,0.365 ,0.032 ])])
56+
57+ if scale_type== " Ty"
58+ params = par_dict_sim[sim_type]
59+ else
60+ params = par_dict_scale[scale_type]
61+ end
62+
63+ T_e = E_z^ (2 / 3 ) * params[1 ] * (M/ (10 ^ 14 * M_sun))^ (params[2 ] + params[3 ] * log10 (M/ (10 ^ 14 * M_sun))) * u " keV"
64+
65+ return T_e
66+ end
67+
68+ function rSZ (𝕡, M_200, z, r; T_scale= " virial" , sim_type= " combination" , showT= true )
5069 """
5170 Calculates the integrated relativistic compton-y signal along the line of sight.
5271 """
5372 # X = (constants.ħ*ω)/(constants.k_B*T_cmb) # omega is standard frequency in Hz
5473 X = 𝕡. X
55- T_e = T_vir_calc (𝕡, M_200, z)
74+ if T_scale== " virial"
75+ T_e = T_vir_calc (𝕡, M_200, z)
76+ elseif typeof (T_scale)== String
77+ T_e = uconvert (u " K" ,(T_mass_calc (𝕡, M_200, z, scale_type= T_scale, sim_type= sim_type)/ constants. k_B))
78+ else
79+ T_e = T_scale
80+ end
5681 θ_e = (constants. k_B* T_e)/ (constants. m_e* constants. c_0^ 2 )
5782 ω = (X* constants. k_B* T_cmb)/ constants. h
5883
0 commit comments