This commit is contained in:
Guilhem Lavaux 2014-07-03 15:37:37 +02:00
parent f2b81d863f
commit eb9d4a2932
6 changed files with 77 additions and 39 deletions

View file

@ -18,11 +18,15 @@ frac_electron = 1.0 # Hmmmm
frac_gas_galaxy = 0.14
mu = 1/(1-0.5*Y)
tmpp_cat={'Msun':3.29,'alpha':-0.7286211634758224,'Mstar':-23.172904033796893,'PhiStar':0.0113246633636846,'lbar':393109973.22508669}
tmpp_cat={'Msun':3.29,
'alpha':-0.7286211634758224,
'Mstar':-23.172904033796893,
'PhiStar':0.0113246633636846,
'lbar':393109973.22508669}
baryon_fraction = Omega_baryon / Omega_matter
ksz_normalization = T_cmb*sigmaT*v_unit/(lightspeed*mu*mp) * baryon_fraction
ksz_normalization = -T_cmb*sigmaT*v_unit/(lightspeed*mu*mp) * baryon_fraction
rho_mean_matter = Omega_matter * (3*(100e3/Mpc)**2/(8*np.pi*G))
Lbar = tmpp_cat['lbar'] / Mpc**3
M_over_L_galaxy = rho_mean_matter / Lbar

View file

@ -1,3 +1,4 @@
import numpy as np
from .constants import *
# -----------------------------------------------------------------------------
@ -11,27 +12,28 @@ class KSZ_Profile(object):
def __init__(self):
self.rGalaxy = 1.0
def evaluate_profile(r):
def evaluate_profile(self, r):
raise NotImplementedError("Abstract function")
def projected_profile(cos_theta,angularDistance):
def projected_profile(self, cos_theta,angularDistance):
idx = np.where(cos_theta > 0)[0]
tan_theta_2 = 1/(cos_theta[idx]**2) - 1
tan_theta_2_max = (self.rGalaxy/angularDistance)**2
tan_theta_2_min = (R_star/angularDistance)**2
tan_theta_2_min = (self.R_star/angularDistance)**2
idx0 = np.where((tan_theta_2 < tan_theta_2_max))
idx = idx[idx0]
tan_theta_2 = tan_theta_2[idx0]
tan_theta = np.sqrt(tan_theta_2)
r = (tan_theta*DA)
r = (tan_theta*angularDistance)
m,idx_mask = self.evaluate_profile(r)
idx_mask = np.append(idx_mask,np.where(tan_theta_2<tan_theta_2_min)[0])
idx_mask = np.append(idx_mask,[tan_theta_2.argmin()])
if tan_theta_2.size > 0:
idx_mask = np.append(idx_mask,[tan_theta_2.argmin()])
return idx,idx_mask,m
@ -75,7 +77,7 @@ class KSZ_Isothermal(KSZ_Profile):
self._table = x,profile
def evaluate_profile(r):
def evaluate_profile(self,r):
rho0, rGalaxy, rInner = self.rho0, self.rGalaxy, self.rInnerGalaxy
Q=rho0*2/r*np.arctan(np.sqrt((rGalaxy/r)**2 - 1))/Mpc
@ -140,7 +142,7 @@ class KSZ_NFW(KSZ_Profile):
return exp(0.971 - 0.094*log(Mvir/(1e12*MassSun)))
def evaluate_profile(r):
def evaluate_profile(self,r):
cs = self._get_concentration(self.Mvir)
rs = self.Rvir/cs