API Reference

xmatch functionality

spherimatch.xmatch(catalog1, catalog2, tolerance, verbose=False) XMatchResult[source]

Performs a cross-match between two catalogs.

This function matches objects from two different catalogs based on their coordinates. Objects from catalog1 and catalog2 that are within a specified angular distance (tolerance) are considered matches.

Parameters:
  • catalog1 (array-like) – The first catalog.

  • catalog2 (array-like) – The second catalog.

  • tolerance (float) – The tolerance for the cross-match in degrees.

  • verbose (bool, optional) – Whether to print the progress.

Returns:

A XMatchResult object that contains the cross-match result.

Return type:

XMatchResult

fof functionality

spherimatch.fof(catalog, tolerance) FoFResult[source]

Perform the Friends-of-Friends (FoF) grouping algorithm on a catalog.

This function applies the FoF algorithm to a given catalog. The algorithm works by linking objects that are within a specified angular distance (tolerance) of each other, forming groups or clusters of objects.

Parameters:
  • catalog (array-like) – The catalog to group.

  • tolerance (float) – The tolerance for the grouping in degrees.

Returns:

The result of the Friends-of-Friends grouping.

Return type:

FoFResult