spheregroup

pydl.pydlutils.spheregroup.spheregroup(ra, dec, linklength, chunksize=None)[source]

Perform friends-of-friends grouping given ra/dec coordinates.

Parameters:
ra, decnumpy.ndarray

Arrays of coordinates to group in decimal degrees.

linklengthfloat

Linking length for the groups in decimal degrees.

chunksizefloat, optional

Break up the sphere into chunks of this size in decimal degrees.

Returns:
tuple

A tuple containing the group number of each object, the multiplicity of each group, the first member of each group, and the next member of the group for each object.

Raises:
PydlutilsException

If the array of coordinates only contains one point.

Notes

It is important that chunksize >= 4 * linklength. This is enforced.

Warning

Behavior at the poles is not well tested.