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

Finds the nearest 3-dimensional matches of this coordinate to a set of catalog coordinates.

This finds the 3-dimensional closest neighbor, which is only different from the on-sky distance if distance is set in this object or the catalogcoord object.

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.

Notes

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

See Also

astropy.coordinates.match_coordinates_3d SkyCoord.match_to_catalog_sky