def _B_1_function(self, z, B_0=None):
"""
calculate B_1(z) function defined in:
Gould A. 1994 ApJ 421L, 71 "Proper motions of MACHOs
http://adsabs.harvard.edu/abs/1994ApJ...421L..71G
Yoo J. et al. 2004 ApJ 603, 139 "OGLE-2003-BLG-262: Finite-Source
Effects from a Point-Mass Lens"
http://adsabs.harvard.edu/abs/2004ApJ...603..139Y
"""
if B_0 is None:
B_0 = self._B_0_function(z)
function = (lambda r, theta: r * np.sqrt(1.-r**2) /
self.parameters.rho / np.sqrt(r**2+zz**2-2.*r*zz*np.cos(theta)))
lim_0 = lambda x: 0
lim_1 = lambda x: 1
W_1 = 0. * z
for (i, zz) in enumerate(z):
W_1[i] = integrate.dblquad(function, 0., 2.*np.pi, lim_0, lim_1)[0]
W_1 /= np.pi
return B_0 - 1.5 * z * self.parameters.rho * W_1
评论列表
文章目录