craftutils.observation.epoch.SkyCoord.match_to_catalog_sky(catalogcoord, nthneighbor=1)

Finds the nearest on-sky matches of this coordinate in a set of catalog coordinates.

For more on how to use this (and related) functionality, see the examples in astropy:/coordinates/matchsep.

Parameters

catalogcoord~astropy.coordinates.SkyCoord or ~astropy.coordinates.BaseCoordinateFrame

The base catalog in which to search for matches. Typically this will be a coordinate object that is an array (i.e., catalogcoord.isscalar == False)

nthneighborint, optional

Which closest neighbor to search for. Typically 1 is desired here, as that is correct for matching one set of coordinates to another. The next likely use case is 2, for matching a coordinate catalog against itself (1 is inappropriate because each point will find itself as the closest match).

Returns

idxint array

Indices into catalogcoord to get the matched points for each of this object’s coordinates. Shape matches this object.

sep2d~astropy.coordinates.Angle

The on-sky separation between the closest match for each element in this object in catalogcoord. Shape matches this object.

dist3d~astropy.units.Quantity [‘length’]

The 3D distance between the closest match for each element in this object in catalogcoord. Shape matches this object. Unless both this and catalogcoord have associated distances, this quantity assumes that all sources are at a distance of 1 (dimensionless).

Notes

This method requires SciPy to be installed or it will fail.

See Also

astropy.coordinates.match_coordinates_sky SkyCoord.match_to_catalog_3d