Skip to content

Commit

Permalink
Switch CpSkyCombineTask to use load-deferred exposures.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Apr 14, 2022
1 parent f467359 commit 37a0cd3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/lsst/cp/pipe/cpSkyTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,13 @@ class CpSkyCombineConnections(pipeBase.PipelineTaskConnections,
dimensions=("instrument", "exposure", "detector"),
multiple=True,
)
inputExps = cT.Input(
inputExpHandles = cT.Input(
name="cpSkyMaskedIsr",
doc="Masked post-ISR image.",
storageClass="Exposure",
dimensions=("instrument", "exposure", "detector"),
multiple=True,
deferLoad=True,
)

outputCalib = cT.Output(
Expand Down Expand Up @@ -391,15 +392,15 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)
self.makeSubtask("sky")

def run(self, inputBkgs, inputExps):
def run(self, inputBkgs, inputExpHandles):
"""Merge per-exposure measurements into a detector level calibration.
Parameters
----------
inputBkgs : `list` [`lsst.afw.math.BackgroundList`]
Remnant backgrounds from each exposure.
inputExps : `list` [`lsst.afw.image.Exposure`]
The ISR processed, detection masked images.
inputHandles : `list` [`lsst.daf.butler.DeferredDatasetHandles`]
The Butler handles to the ISR processed, detection masked images.
Returns
-------
Expand All @@ -410,9 +411,9 @@ def run(self, inputBkgs, inputExps):
The final sky calibration product.
"""
skyCalib = self.sky.averageBackgrounds(inputBkgs)
skyCalib.setDetector(inputExps[0].getDetector())
skyCalib.setDetector(inputExpHandles[0].get(component='detector'))

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

return pipeBase.Struct(
outputCalib=skyCalib,
Expand Down

0 comments on commit 37a0cd3

Please sign in to comment.