def match_to_database(source_list, image_list, cat, Ast, imscale, thresh=8.):
'''
RA, Decdetection catalogs and vizier (astroquery) match? vo conesearch?
'''
matches = []
for sources, image in zip(source_list, image_list):
ifuslot = sources[1]
Ast.get_ifuslot_projection(ifuslot, imscale, image.shape[1]/2.,
image.shape[0]/2.)
for source in sources[0]:
ra, dec = Ast.tp_ifuslot.wcs.wcs_pix2world(source['xcentroid'],
source['ycentroid'],1)
c = SkyCoord(ra, dec, unit=(unit.degree, unit.degree))
idx, d2d, d3d = match_coordinates_sky(c, cat, nthneighbor=1)
if d2d.arcsec[0] < thresh:
dra = cat.ra[idx].deg - float(ra)
ddec = cat.dec[idx].deg - float(dec)
matches.append([int(ifuslot),int(idx),
float(ra), float(dec),
cat.ra[idx].deg,
cat.dec[idx].deg, dra, ddec,
d2d.arcsec[0]])
return matches
评论列表
文章目录