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-45426: Account for warps from make_direct_warp are bigger #64

Merged
merged 1 commit into from
Aug 14, 2024
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
10 changes: 5 additions & 5 deletions python/lsst/drp/tasks/assemble_coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
else:
psfMatchedWarpRefList = []

inputs = self.prepareInputs(warpRefList, psfMatchedWarpRefList)
inputs = self.prepareInputs(warpRefList, inputData["skyInfo"].bbox, psfMatchedWarpRefList)
self.log.info("Found %d %s", len(inputs.warpRefList), self.getTempExpDatasetName(self.warpType))
if len(inputs.warpRefList) == 0:
raise pipeBase.NoWorkFound("No coadd temporary exposures found")
Expand Down Expand Up @@ -492,7 +492,7 @@ def _makeSupplementaryData(self, butlerQC, inputRefs, outputRefs):
def makeSupplementaryDataGen3(self, butlerQC, inputRefs, outputRefs):
return self._makeSupplementaryData(butlerQC, inputRefs, outputRefs)

def prepareInputs(self, refList, psfMatchedWarpRefList=None):
def prepareInputs(self, refList, coadd_bbox, psfMatchedWarpRefList=None):
"""Prepare the input warps for coaddition by measuring the weight for
each warp and the scaling for the photometric zero point.

Expand Down Expand Up @@ -547,7 +547,7 @@ def prepareInputs(self, refList, psfMatchedWarpRefList=None):

warpName = self.getTempExpDatasetName(self.warpType)
for warpRef in refList:
warp = warpRef.get()
warp = warpRef.get(parameters={"bbox": coadd_bbox})
# Ignore any input warp that is empty of data
if numpy.isnan(warp.image.array).all():
continue
Expand Down Expand Up @@ -994,7 +994,7 @@ def assembleOnlineMeanCoadd(
for warpRef, imageScaler, altMask, weight in zip(
warpRefList, imageScalerList, altMaskList, weightList
):
exposure = warpRef.get()
exposure = warpRef.get(parameters={"bbox": bbox})
maskedImage = exposure.getMaskedImage()
mask = maskedImage.getMask()
if altMask is not None:
Expand Down Expand Up @@ -1927,7 +1927,7 @@ def _readAndComputeWarpDiff(self, warpRef, imageScaler, templateCoadd):
if warpRef is None:
return None

warp = warpRef.get()
warp = warpRef.get(parameters={"bbox": templateCoadd.getBBox()})
# direct image scaler OK for PSF-matched Warp
imageScaler.scaleMaskedImage(warp.getMaskedImage())
mi = warp.getMaskedImage()
Expand Down
5 changes: 2 additions & 3 deletions tests/test_assemble_coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ def runQuantum(self, mockSkyInfo, warpRefList, **kwargs):
retStruct : `lsst.pipe.base.Struct`
The coadded exposure and associated metadata.
"""
inputs = self.prepareInputs(warpRefList)

inputs = self.prepareInputs(warpRefList, mockSkyInfo.bbox)
retStruct = self.run(
mockSkyInfo,
warpRefList=inputs.warpRefList,
Expand Down Expand Up @@ -124,7 +123,7 @@ def __init__(self, *args, **kwargs):
CompareWarpAssembleCoaddTask.__init__(self, *args, **kwargs)

def runQuantum(self, mockSkyInfo, warpRefList, psfMatchedWarpRefList=None, *args):
inputs = self.prepareInputs(warpRefList, psfMatchedWarpRefList)
inputs = self.prepareInputs(warpRefList, mockSkyInfo.bbox, psfMatchedWarpRefList)

assembleStaticSkyModel = MockAssembleCoaddTask(config=self.config.assembleStaticSkyModel)
templateCoadd = assembleStaticSkyModel.runQuantum(mockSkyInfo, warpRefList)
Expand Down
Loading