Ensure the point at r=0 has correct value and not nan

This commit is contained in:
Guilhem Lavaux 2014-12-02 17:36:52 +01:00
parent 83324fdbd1
commit 00d8d619ef
2 changed files with 6 additions and 2 deletions

View file

@ -71,7 +71,10 @@ class KSZ_Isothermal(KSZ_Profile):
Q = np.zeros(r.size)
cond = (r>=0)*(r <= rInner)
cond = (r<=0)
Q[cond] = rho0*2/Mpc * (rGalaxy-rInner)/(rGalaxy*rInner)
cond = (r>0)*(r <= rInner)
D['r'] = r[cond]
Q[cond] = ne.evaluate('rho0*2/(Mpc*r) * (arctan(sqrt( (rGalaxy/r)**2 -1 )) - arctan(sqrt( (rInner/r)**2 - 1 )))',
local_dict=D)