def bulge_Sigma(R): return sersic.Sigma(R, nser, reff * arcsec2kpc)
def get_source_kappa(self): self.sources['kappa'] = (self.S_h*adcontr.Sigma(sources['r'], self.fbar, self.reff_ang, self.rs_ang, self.c200, self.nu) + \ self.S_bulge*sersic.Sigma(self.sources['r']/self.reff_ang, self.nser, 1.)) / self.sources['s_cr']
def rho(r): # stellar density deriv = lambda R: -sersic.b(nser)/nser*(R/(reff))**(1/nser)/R*sersic.Sigma(R, nser, reff) return -1./np.pi*quad(lambda R: deriv(R)/(R**2 - r**2)**0.5, r, np.inf)[0]
def Sigma(self, theta): # surface mass density in M_Sun/pc^2 return (2. * self.S_s * nfw.Ffunc(theta / self.rs_ang) + self.S_bulge * sersic.Sigma(theta / self.reff_ang, self.nser, 1.)) / 1e12
def get_source_gammat(self): self.sources['gammat'] = (self.S_h/np.pi/(self.sources['r']/self.rs_ang)**2*adcontr.M2d(self.sources['r'], self.fbar, self.reff_ang, self.rs_ang, self.c200, self.nu) + \ -self.S_h*adcontr.Sigma(self.sources['r'], self.fbar, self.reff_ang, self.rs_ang, self.c200, self.nu) + \ self.S_bulge*(sersic.M2d(self.sources['r'], self.nser, self.reff_ang)/(self.sources['r']/self.reff_ang)**2/pi - \ sersic.Sigma(self.sources['r']/self.reff_ang, self.nser, 1.))) / self.sources['s_cr']
def kappa(self, theta, z): return ( 2. * self.S_s * nfw.Ffunc(theta / self.rs_ang) + self.S_bulge * sersic.Sigma(theta / self.reff_ang, self.nser, 1.)) / self.S_cr(z)
def gammat(self, theta, z): return (2.*self.S_s*(2.*nfw.gfunc(theta/self.rs_ang)/(theta/self.rs_ang)**2 - nfw.Ffunc(theta/self.rs_ang)) + \ self.S_bulge*(sersic.M2d(theta, self.nser, self.reff_ang)/(theta/self.reff_ang)**2/pi - \ sersic.Sigma(theta/self.reff_ang, self.nser, 1.))) / self.S_cr(z)
def get_source_kappa(self): self.sources['kappa'] = (2.*self.S_s*nfw.Ffunc(self.sources['r']/self.rs_ang) + \ self.S_bulge*sersic.Sigma(self.sources['r']/self.reff_ang, self.nser, 1.)) / self.sources['s_cr']
def get_source_gammat(self): self.sources['gammat'] = (2.*self.S_s*(2.*nfw.gfunc(self.sources['r']/self.rs_ang)/(self.sources['r']/self.rs_ang)**2 + \ - nfw.Ffunc(self.sources['r']/self.rs_ang)) + \ self.S_bulge*(sersic.M2d(self.sources['r'], self.nser, self.reff_ang)/(self.sources['r']/self.reff_ang)**2/pi - \ sersic.Sigma(self.sources['r']/self.reff_ang, self.nser, 1.))) / self.sources['s_cr']
def kappa(x): # dimensionless surface mass density return (10.**lmstar * sersic.Sigma(x, nser, reff) + 10.**lm200_samp[i] / nfw.M3d(r200, rs) * nfw.Sigma(x, rs)) / s_cr