spherematch

pydl.pydlutils.spheregroup.spherematch(ra1, dec1, ra2, dec2, matchlength, chunksize=None, maxmatch=1)[source]

Match points on a sphere.

Parameters
ra1, dec1, ra2, dec2numpy.ndarray

The sets of coordinates to match. Assumed to be in decimal degrees

matchlengthfloat

Two points closer than this separation are matched. Assumed to be in decimal degrees.

chunksizefloat, optional

Value to pass to chunk assignment.

maxmatchint, optional

Allow up to maxmatch matches per coordinate. Default 1. If set to zero, All possible matches will be returned.

Returns
tuple

A tuple containing the indices into the first set of points, the indices into the second set of points and the match distance in decimal degrees.

Notes

If you have sets of coordinates that differ in size, call this function with the larger list first. This exploits the inherent asymmetry in the underlying code to reduce memory use.

Warning

Behavior at the poles is not well tested.