3535import astropy .table
3636import astropy .units as u
3737import numpy as np
38- import pandas as pd
3938from smatch .matcher import sphdist
4039from typing import Sequence
41- import warnings
4240
4341
4442def is_sequence_set (x : Sequence ):
@@ -300,25 +298,25 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
300298
301299 def run (
302300 self ,
303- catalog_ref : pd . DataFrame | astropy .table .Table ,
304- catalog_target : pd . DataFrame | astropy .table .Table ,
305- catalog_match_ref : pd . DataFrame | astropy .table .Table ,
306- catalog_match_target : pd . DataFrame | astropy .table .Table ,
301+ catalog_ref : astropy .table .Table ,
302+ catalog_target : astropy .table .Table ,
303+ catalog_match_ref : astropy .table .Table ,
304+ catalog_match_target : astropy .table .Table ,
307305 wcs : afwGeom .SkyWcs = None ,
308306 ) -> pipeBase .Struct :
309307 """Load matched reference and target (measured) catalogs, measure summary statistics, and output
310308 a combined matched catalog with columns from both inputs.
311309
312310 Parameters
313311 ----------
314- catalog_ref : `pandas.DataFrame` | ` astropy.table.Table`
312+ catalog_ref : `astropy.table.Table`
315313 A reference catalog to diff objects/sources from.
316- catalog_target : `pandas.DataFrame` | ` astropy.table.Table`
314+ catalog_target : `astropy.table.Table`
317315 A target catalog to diff reference objects/sources to.
318- catalog_match_ref : `pandas.DataFrame` | ` astropy.table.Table`
316+ catalog_match_ref : `astropy.table.Table`
319317 A catalog with match indices of target sources and selection flags
320318 for each reference source.
321- catalog_match_target : `pandas.DataFrame` | ` astropy.table.Table`
319+ catalog_match_target : `astropy.table.Table`
322320 A catalog with selection flags for each target source.
323321 wcs : `lsst.afw.image.SkyWcs`
324322 A coordinate system to convert catalog positions to sky coordinates,
@@ -333,19 +331,6 @@ def run(
333331 # Would be nice if this could refer directly to ConfigClass
334332 config : DiffMatchedTractCatalogConfig = self .config
335333
336- is_ref_pd = isinstance (catalog_ref , pd .DataFrame )
337- is_target_pd = isinstance (catalog_target , pd .DataFrame )
338- is_match_ref_pd = isinstance (catalog_match_ref , pd .DataFrame )
339- is_match_target_pd = isinstance (catalog_match_target , pd .DataFrame )
340- if is_ref_pd :
341- catalog_ref = astropy .table .Table .from_pandas (catalog_ref )
342- if is_target_pd :
343- catalog_target = astropy .table .Table .from_pandas (catalog_target )
344- if is_match_ref_pd :
345- catalog_match_ref = astropy .table .Table .from_pandas (catalog_match_ref )
346- if is_match_target_pd :
347- catalog_match_target = astropy .table .Table .from_pandas (catalog_match_target )
348-
349334 # Strip any provenance from tables before merging to prevent
350335 # warnings from conflicts being issued by astropy.utils.merge during
351336 # vstack or hstack calls.
@@ -354,11 +339,6 @@ def run(
354339 DatasetProvenance .strip_provenance_from_flat_dict (catalog_match_ref .meta )
355340 DatasetProvenance .strip_provenance_from_flat_dict (catalog_match_target .meta )
356341
357- # TODO: Remove pandas support in DM-46523
358- if is_ref_pd or is_target_pd or is_match_ref_pd or is_match_target_pd :
359- warnings .warn ("pandas usage in MatchProbabilisticTask is deprecated; it will be removed "
360- " in favour of astropy.table after release 28.0.0" , category = FutureWarning )
361-
362342 select_ref = catalog_match_ref ['match_candidate' ]
363343 # Add additional selection criteria for target sources beyond those for matching
364344 # (not recommended, but can be done anyway)
0 commit comments