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-31986: "filter label mismatch" on loading cp_pipe calibration #130

Merged
merged 3 commits into from
Jun 9, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 31 additions & 1 deletion python/lsst/cp/pipe/cpCombine.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ def run(self, inputExpHandles, inputScales=None, inputDims=None):
# Set the detector
combinedExp.setDetector(inputDetector)

# Do we need to set a filter?
filterLabel = inputExpHandles[0].get(component="filterLabel")
self.setFilter(combinedExp, filterLabel)

# Return
return pipeBase.Struct(
outputData=combinedExp,
Expand Down Expand Up @@ -577,6 +581,19 @@ def interpolateNans(self, exp):
array[bad] = median
self.log.warning("Found and fixed %s NAN pixels", count)

@staticmethod
def setFilter(exp, filterLabel):
"""Dummy function that will not assign a filter.

Parameters
----------
exp : `lsst.afw.image.Exposure`
Exposure to assign filter to.
filterLabel : `lsst.afw.image.FilterLabel`
Filter to assign.
"""
pass


# Create versions of the Connections, Config, and Task that support
# filter constraints.
Expand Down Expand Up @@ -615,4 +632,17 @@ class CalibCombineByFilterTask(CalibCombineTask):

ConfigClass = CalibCombineByFilterConfig
_DefaultName = "cpFilterCombine"
pass

@staticmethod
def setFilter(exp, filterLabel):
"""Dummy function that will not assign a filter.

Parameters
----------
exp : `lsst.afw.image.Exposure`
Exposure to assign filter to.
filterLabel : `lsst.afw.image.FilterLabel`
Filter to assign.
"""
if filterLabel:
exp.setFilter(filterLabel)
1 change: 1 addition & 0 deletions python/lsst/cp/pipe/cpSkyTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def run(self, inputBkgs, inputExpHandles):
"""
skyCalib = self.sky.averageBackgrounds(inputBkgs)
skyCalib.setDetector(inputExpHandles[0].get(component='detector'))
skyCalib.setFilter(inputExpHandles[0].get(component='filterLabel'))

CalibCombineTask().combineHeaders(inputExpHandles, skyCalib, calibType='SKY')

Expand Down