def xmatch_basic(ra1, dec1, ra2, dec2, match_radius=5.0):
'''
This is a quick matcher that uses great_circle_dist to find the closest
object in (ra2,dec2) within match_radius to (ra1,dec1). (ra1,dec1) must be a
scalar pair, while (ra2,dec2) must be np.arrays of the same lengths.
PARAMETERS:
ra1/dec1: coordinates of the target to match
ra2/dec2: coordinate np.arrays of the list of coordinates to match to
RETURNS:
A tuple like the following:
(True -> no match or False -> matched,
minimum distance between target and list)
'''
min_dist_arcsec = np.min(great_circle_dist(ra1,dec1,ra2,dec2))
if (min_dist_arcsec < match_radius):
return (True,min_dist_arcsec)
else:
return (False,min_dist_arcsec)
评论列表
文章目录