def bg_lum_hi(pp, qq):
# Tested 2011-08-31
"""Exact deprojection of Sersic profile using Meijer G function as
described by Baes + Gentile 1009.4713. Use formula valid for half
integers"""
if not (pp==int(pp) and qq==int(qq)): raise RuntimeError
if not (qq == 1 or qq == 2): raise RuntimeError
pp, qq = int(pp), int(qq)
mm = (1.0*pp)/qq
i0, bb = bg_constants(pp, qq)
# a and b vectors are specified: [[num1, num2, num3],[denom1,denom2,denom3]]
avect = [[], []]
nums = range(1,2*pp/qq)
bvect = [[xx/(2.0*mm) for xx in nums] + [0.5], []]
reff = 1.0
factor = 2*i0*np.sqrt(mm)/(reff*(2*np.pi)**mm)
def lum(rr):
if np.iterable(rr): return np.array([lum(r) for r in rr])
ss = rr/reff
zz = (bb/(2*mm))**(2*mm) * ss**2
return (factor/ss)*mpmath.meijerg(avect, bvect, zz)
return lum
##################################################
## The big money function is defined right here! The name conforms to
## naming conventions used throughout this file, but is nearly useless
## to users. So make it available as luminosity() to users via a line
## in __init__.py since it's likely the only function any user will
## care about.
评论列表
文章目录