def arcsec2pc(d=15.,a=1.):
"""
Given the input angular size and distance to the object, computes
the corresponding linear size in pc.
:param d: distance in Mpc
:param a: angular size in arcsec
:returns: linear size in pc
"""
# convert arcsec to radians
a=a*4.848e-6
# convert distance to pc instead of Mpc
d=d*1e6
return d*numpy.tan(a)
评论列表
文章目录