astropy/astropy — pull request #1535 by eteq (2013-10-07 04:14:31+00:00)
Title: Implement Matching between two sets of coordinates

The PR builds off of the enabling of array coordinates in #1499 to make it easy to match two sets of coordinates. E.g., if you have a source catalog from an image you just reduced, you can use this to find the closest matches between those sources and some other set of coordinates (say, an SDSS catalog you downloaded of the same field). It will even automatically convert if one of them is a different set of coordinates than the other.

It uses scipy's KDTree (the C implementation), so it's quite fast even for large numbers of coordinates.

One question:
* Right now there is both a `match_to_catalog` method on the coordinates (which is used like ``c1.match_to_catalog(c2)`` and a `match_coordinates` function(``match_coordinates(c1, c2)``). Should we have both in the public API? If not, which should be kept?

Note that this is, by necessity, based on #1499, so all commits before eteq/astropy@53c0171 should be ignored for this. That makes the diff a bit difficult to read, but that will hopefully clear up when #1499 is merged.