lsdb.core.crossmatch.crossmatch#

Functions#

_validate_and_convert_to_catalog(→ lsdb.catalog.Catalog)

Validate arguments and convert a DataFrame or NestedFrame to a Catalog.

crossmatch(→ lsdb.catalog.Catalog)

Perform a cross-match between two frames, two catalogs, a catalog and a frame, or a frame and

Module Contents#

_validate_and_convert_to_catalog(data: nested_pandas.NestedFrame | pandas.DataFrame, data_args: dict, suffix: str | None, default_suffix: str) lsdb.catalog.Catalog[source]#

Validate arguments and convert a DataFrame or NestedFrame to a Catalog.

crossmatch(left: lsdb.catalog.Catalog | nested_pandas.NestedFrame | pandas.DataFrame, right: lsdb.catalog.Catalog | nested_pandas.NestedFrame | pandas.DataFrame, ra_column: str | None = None, dec_column: str | None = None, suffixes: tuple[str, str] | None = None, algorithm: Type[lsdb.core.crossmatch.abstract_crossmatch_algorithm.AbstractCrossmatchAlgorithm] | lsdb.core.crossmatch.crossmatch_algorithms.BuiltInCrossmatchAlgorithm = BuiltInCrossmatchAlgorithm.KD_TREE, output_catalog_name: str | None = None, require_right_margin: bool = False, left_args: dict | None = None, right_args: dict | None = None, **kwargs) lsdb.catalog.Catalog[source]#

Perform a cross-match between two frames, two catalogs, a catalog and a frame, or a frame and a catalog.

See Catalog.crossmatch for more information on cross-matching.

Parameters:
  • left (Catalog | NestedFrame) – The left catalog or frame to crossmatch.

  • right (Catalog | NestedFrame) – The right catalog or frame to crossmatch.

  • ra_column (str, optional) – The name of the right ascension column for both catalogs, if passing dataframes. Can be specified in the left_args or right_args dictionaries if left and right catalogs have different RA column names. Defaults to None, which will use the default column names “ra”, “Ra”, or “RA” if they exist in the DataFrame.

  • dec_column (str, optional) – The name of the declination column for both catalogs, if passing dataframes. Can be specified in the left_args or right_args dictionaries if left and right catalogs have different dec column names. Defaults to None, which will use the default column names “dec”, “Dec”, or “DEC” if they exist in the DataFrame.

  • suffixes (tuple[str, str], optional) – Suffixes to append to overlapping column names. Defaults to None.

  • algorithm (Type[AbstractCrossmatchAlgorithm] | BuiltInCrossmatchAlgorithm, optional) – The crossmatch algorithm to use. Defaults to BuiltInCrossmatchAlgorithm.KD_TREE.

  • output_catalog_name (str, optional) – The name of the output catalog. Defaults to None.

  • require_right_margin (bool, optional) – Whether to require a right margin. Defaults to False.

  • left_args (dict, optional) – Keyword arguments to pass to from_dataframe for the left catalog. Defaults to None.

  • right_args (dict, optional) – Keyword arguments to pass to from_dataframe for the right catalog. Defaults to None.

  • **kwargs – Additional keyword arguments to pass to Catalog.crossmatch.

Returns:

The crossmatched catalog.

Return type:

Catalog