Skip to content

Commit

Permalink
Merge pull request #1024 from lsst/tickets/DM-47730
Browse files Browse the repository at this point in the history
DM-47730: Use new refcat loader method to improve refcat flux field checks.
  • Loading branch information
TallJimbo authored Jan 21, 2025
2 parents 8ffcb69 + bc9eaaf commit 6b5a48f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
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):
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

0 comments on commit 6b5a48f

Please sign in to comment.