Skip to content

Commit

Permalink
Use new refcat loader method to improve refcat flux field checks.
Browse files Browse the repository at this point in the history
The new implementation no longer assumes there is a refcat shard
overlapping the center of a tract, which was important for ci_hsc.
  • Loading branch information
TallJimbo committed Jan 15, 2025
1 parent afaee74 commit 416d8fa
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 416d8fa

Please sign in to comment.