diff --git a/src/lsdb/catalog/catalog.py b/src/lsdb/catalog/catalog.py index 6efd13e9..8d51febb 100644 --- a/src/lsdb/catalog/catalog.py +++ b/src/lsdb/catalog/catalog.py @@ -132,9 +132,13 @@ def crossmatch( The function should be able to perform a crossmatch on two pandas DataFrames from a HEALPix pixel from each catalog. It should return a dataframe with the - combined set of columns from the input dataframes with the appropriate suffixes, - and a column with the name {AbstractCrossmatchAlgorithm.DISTANCE_COLUMN_NAME} - with the distance between the points. + combined set of columns from the input dataframes with the appropriate suffixes + and, eventually, a set of extra columns generated by the crossmatch algorithm. + These columns are specified in {AbstractCrossmatchAlgorithm.extra_columns}, with + their respective data types, by means of an empty pandas dataframe. As an example, + the KdTreeCrossmatch algorithm outputs a "_DIST" column with the distance between + data points. Its extra_columns attribute is specified as follows: + `pd.DataFrame({"_DIST": pd.Series(dtype=np.dtype("float64"))})`. The class will have been initialized with the following parameters, which the crossmatch function should use: @@ -161,9 +165,8 @@ def crossmatch( pair of neighbors found from cross-matching. The resulting table contains all columns from the left and right catalogs with their - respective suffixes, and a column with the name - {AbstractCrossmatchAlgorithm.DISTANCE_COLUMN_NAME} with the great circle separation - between the points. + respective suffixes and, whenever specified, a set of extra columns generated by the + crossmatch algorithm. """ if suffixes is None: suffixes = (f"_{self.name}", f"_{other.name}") diff --git a/src/lsdb/core/crossmatch/kdtree_match.py b/src/lsdb/core/crossmatch/kdtree_match.py index a2d464a1..23efd1c5 100644 --- a/src/lsdb/core/crossmatch/kdtree_match.py +++ b/src/lsdb/core/crossmatch/kdtree_match.py @@ -33,8 +33,7 @@ def crossmatch( A DataFrame from the left and right tables merged with one row for each pair of neighbors found from cross-matching. The resulting table contains the columns from the left table with the first suffix appended, the right columns with the second suffix, and - a column with the name {AbstractCrossmatchAlgorithm.DISTANCE_COLUMN_NAME} with the great - circle separation between the points. + a "_DIST" column with the great circle separation between the points. """ # Distance in 3-D space for unit sphere d_chord = 2.0 * math.sin(math.radians(0.5 * d_thresh))