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-47730: Use new refcat loader method to improve refcat flux field checks. #1024

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions python/lsst/pipe/tasks/loadReferenceCatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
from lsst.afw.image import abMagErrFromFluxErr
from lsst.meas.algorithms import ReferenceObjectLoader, LoadReferenceObjectsConfig

import lsst.geom


class LoadReferenceCatalogConfig(pexConfig.Config):
"""Config for LoadReferenceCatalogTask"""
Expand Down Expand Up @@ -340,9 +338,7 @@ def _determineFluxFields(self, center, filterList):
if refFilterName is None:
continue
try:
results = self.refObjLoader.loadSkyCircle(center,
0.05*lsst.geom.degrees,
refFilterName)
results = self.refObjLoader.loadSchema(refFilterName)
foundReferenceFilter = True
self._referenceFilter = refFilterName
break
Expand Down Expand Up @@ -377,7 +373,7 @@ def _determineFluxFields(self, center, filterList):

if refFilterName is not None:
try:
fluxField = getRefFluxField(results.refCat.schema, filterName=refFilterName)
fluxField = getRefFluxField(results.schema, filterName=refFilterName)
except RuntimeError:
# This flux field isn't available. Set to None
fluxField = None
Expand Down
8 changes: 8 additions & 0 deletions tests/test_loadReferenceCatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ def loadSkyCircle(self, ctrCoord, radius, filterName, **kwargs):
def loadPixelBox(self, bbox, wcs, referenceFilter, **kwargs):
return self.loadSkyCircle(None, None, referenceFilter)

def loadSchema(self, filterName):
jrmullaney marked this conversation as resolved.
Show resolved Hide resolved
refCat = self.make_synthetic_refcat(_synthCenter, _synthFlux)
fluxField = getRefFluxField(schema=refCat.schema, filterName=filterName)
return pipeBase.Struct(
schema=refCat.schema,
fluxField=fluxField
)


class LoadReferenceCatalogTestCase(lsst.utils.tests.TestCase):
@classmethod
Expand Down
Loading