Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-40797: Switch from Gaia DR2 to DR3 for astrometry matching #76

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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