Skip to content

Commit

Permalink
Merge branch 'tickets/DM-40797'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenam committed Dec 21, 2023
2 parents 308fc04 + f462e3d commit efe92d1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions python/lsst/analysis/drp/catalogMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def run(self, refCatalog, targetCatalog):
separations: `astropy.coordinates.angles.Angle`
Array of angle separations between matched objects
"""
# Get rid of entries in the refCat with non-finite RA/Dec values.
refRas = refCatalog['coord_ra']
refDecs = refCatalog['coord_dec']
refRaDecFiniteMask = np.isfinite(refRas) & np.isfinite(refDecs)
refCatalog = refCatalog[refRaDecFiniteMask]
refCat_ap = SkyCoord(ra=refCatalog['coord_ra'].values * u.degree,
dec=refCatalog['coord_dec'].values * u.degree)

Expand Down Expand Up @@ -85,7 +90,7 @@ class CatalogMatchConnections(pipeBase.PipelineTaskConnections, dimensions=("tra

refCat = pipeBase.connectionTypes.PrerequisiteInput(
doc="The reference catalog to match to loaded input catalog sources.",
name="gaia_dr2_20200414",
name="gaia_dr3_20230707",
storageClass="SimpleCatalog",
dimensions=("skypix",),
deferLoad=True,
Expand Down Expand Up @@ -271,11 +276,17 @@ def setRefCat(self, skymap, tract):
'i',
epoch=epoch)
refCat = skyCircle.refCat
# Get rid of entries in the refCat with non-finite RA/Dec values.
refRas = refCat['coord_ra']
refDecs = refCat['coord_dec']
refRaDecFiniteMask = np.isfinite(refRas) & np.isfinite(refDecs)
refCat = refCat[refRaDecFiniteMask].copy(deep=True)

# Convert the coordinates to RA/Dec and convert the catalog to a
# dataframe
refCat['coord_ra'] = (refCat['coord_ra'] * u.radian).to(u.degree).to_value()
refCat['coord_dec'] = (refCat['coord_dec'] * u.radian).to(u.degree).to_value()

self.refCat = refCat.asAstropy().to_pandas()


Expand All @@ -293,7 +304,7 @@ class CatalogMatchVisitConnections(pipeBase.PipelineTaskConnections, dimensions=

refCat = pipeBase.connectionTypes.PrerequisiteInput(
doc="The astrometry reference catalog to match to loaded input catalog sources.",
name="gaia_dr2_20200414",
name="gaia_dr3_20230707",
storageClass="SimpleCatalog",
dimensions=("skypix",),
deferLoad=True,
Expand Down

0 comments on commit efe92d1

Please sign in to comment.