Barak 0.3.2 documentation

barak.coord.match

«  barak.coord.indmatch   ::   Contents   ::   barak.coord.ra_dec2s  »

barak.coord.match

barak.coord.match(ra1, dec1, ra2, dec2, tol, allmatches=False)[source]

Given two sets of numpy arrays of ra,dec and a tolerance tol, returns an array of indices and separations with the same length as the first input array.

If an index is > 0, it is the index of the closest matching second array element within tol arcsec. If it’s -1, then there was no matching ra/dec within tol arcsec.

If allmatches = True, then for each object in the first array, return the index and separation of everything in the second array within the search tolerance, not just the closest match.

Notes

To get the indices of objects in ra2, dec2 without a match, use

>>> imatch = match(ra1, dec1, ra2, dec2, 2.)
>>> inomatch = numpy.setdiff1d(np.arange(len(ra2)), set(imatch))

«  barak.coord.indmatch   ::   Contents   ::   barak.coord.ra_dec2s  »