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 3c3afe3 + 77ac61d commit 82188b7
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pipelines/coaddQualityCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tasks:
catalogMatchTract:
class: lsst.analysis.tools.tasks.astrometricCatalogMatch.AstrometricCatalogMatchTask
config:
connections.refCatalog: gaia_dr2_20200414
connections.refCatalog: gaia_dr3_20230707
refCatObjectTract:
class: lsst.analysis.tools.tasks.refCatObjectAnalysis.RefCatObjectAnalysisTask
config:
Expand Down
2 changes: 1 addition & 1 deletion pipelines/visitQualityCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks:
catalogMatchVisit:
class: lsst.analysis.tools.tasks.astrometricCatalogMatch.AstrometricCatalogMatchVisitTask
config:
connections.refCatalog: gaia_dr2_20200414
connections.refCatalog: gaia_dr3_20230707
astrometricRefCatSourceVisit:
class: lsst.analysis.tools.tasks.refCatSourceAnalysis.RefCatSourceAnalysisTask
config:
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/analysis/tools/tasks/astrometricCatalogMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
class AstrometricCatalogMatchVisitConnections(
pipeBase.PipelineTaskConnections,
dimensions=("visit",),
defaultTemplates={"targetCatalog": "sourceTable_visit", "refCatalog": "gaia_dr2_20200414"},
defaultTemplates={"targetCatalog": "sourceTable_visit", "refCatalog": "gaia_dr3_20230707"},
):
catalog = pipeBase.connectionTypes.Input(
doc="The visit-wide catalog to make plots from.",
storageClass="ArrowAstropy",
name="sourceTable_visit",
name="{targetCatalog}",
dimensions=("visit",),
deferLoad=True,
)

refCat = pipeBase.connectionTypes.PrerequisiteInput(
doc="The astrometry reference catalog to match to loaded input catalog sources.",
name="gaia_dr2_20200414",
name="{refCatalog}",
storageClass="SimpleCatalog",
dimensions=("skypix",),
deferLoad=True,
Expand Down
6 changes: 6 additions & 0 deletions python/lsst/analysis/tools/tasks/catalogMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ def run(self, *, catalog, loadedRefCat, bands):
# Which I think is okay, but the current task
# allows different units. Need to configure match
# radius, either in this task or a subtask.

# Get rid of entries in the refCat with non-finite RA/Dec values.
refRas = loadedRefCat["ra"]
refDecs = loadedRefCat["dec"]
refRaDecFiniteMask = np.isfinite(refRas) & np.isfinite(refDecs)
loadedRefCat = loadedRefCat[refRaDecFiniteMask]
with Matcher(loadedRefCat["ra"], loadedRefCat["dec"]) as m:
idx, refMatchIndices, targetMatchIndices, dists = m.query_radius(
targetCatalog[self.config.raColumn],
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/analysis/tools/tasks/refCatObjectAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class RefCatObjectAnalysisConnections(
dimensions=("skymap", "tract"),
defaultTemplates={
"targetCatalog": "objectTable_tract",
"refCatalog": "gaia_dr2_20200414",
"outputName": "objectTable_tract_gaia_dr2_20200414_match",
"refCatalog": "gaia_dr3_20230707",
"outputName": "objectTable_tract_gaia_dr3_20230707_match",
},
):
data = ct.Input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
class RefCatObjectPhotometricAnalysisConnections(
AnalysisBaseConnections,
dimensions=("skymap", "tract"),
defaultTemplates={"outputName": "objectTable_tract_ps1_pv3_3pi_20170110_match"},
defaultTemplates={
"targetCatalog": "objectTable_tract",
"refCatalog": "ps1_pv3_3pi_20170110",
"outputName": "objectTable_tract_ps1_pv3_3pi_20170110_match",
},
):
data = ct.Input(
doc="Tract based object table to load from the butler",
name="objectTable_tract_ps1_pv3_3pi_20170110_match",
name="{targetCatalog}_{refCatalog}_match",
storageClass="ArrowAstropy",
deferLoad=True,
dimensions=("skymap", "tract"),
Expand Down
8 changes: 6 additions & 2 deletions python/lsst/analysis/tools/tasks/refCatSourceAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
class RefCatSourceAnalysisConnections(
AnalysisBaseConnections,
dimensions=("visit",),
defaultTemplates={"outputName": "sourceTable_visit_gaia_dr2_20200414_match"},
defaultTemplates={
"targetCatalog": "sourceTable_visit",
"refCatalog": "gaia_dr3_20230707",
"outputName": "sourceTable_visit_gaia_dr3_20230707_match",
},
):
data = ct.Input(
doc="Tract based object table to load from the butler",
name="sourceTable_visit_gaia_dr2_20200414_match",
name="{targetCatalog}_{refCatalog}_match",
storageClass="ArrowAstropy",
deferLoad=True,
dimensions=("visit",),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_catalogMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def setUp(self):
loaderTask = LoadReferenceCatalogTask(
config=config.referenceCatalogLoader,
dataIds=[refDataId],
name="gaia_dr2_20200414",
name="gaia_dr3_20230707",
refCats=[deferredRefCat],
)
self.loadedRefCat = self.task._loadRefCat(loaderTask, tract)
Expand Down

0 comments on commit 82188b7

Please sign in to comment.