Skip to content

Commit

Permalink
Add kernelSources to subtractImages output
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Oct 29, 2024
1 parent 9c4cc4c commit 1f67374
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions python/lsst/ip/diffim/subtractImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class SubtractImageOutputConnections(lsst.pipe.base.PipelineTaskConnections,
storageClass="MatchingKernel",
name="{fakesType}{coaddName}Diff_psfMatchKernel",
)
kernelSources = connectionTypes.Output(
doc="Final selection of sources used for psf matching.",
dimensions=("instrument", "visit", "detector"),
storageClass="SourceCatalog",
name="{fakesType}{coaddName}Diff_psfMatchSources"
)


class SubtractScoreOutputConnections(lsst.pipe.base.PipelineTaskConnections,
Expand All @@ -117,6 +123,12 @@ class SubtractScoreOutputConnections(lsst.pipe.base.PipelineTaskConnections,
storageClass="MatchingKernel",
name="{fakesType}{coaddName}Diff_psfScoreMatchKernel",
)
kernelSources = connectionTypes.Output(
doc="Final selection of sources used for psf matching.",
dimensions=("instrument", "visit", "detector"),
storageClass="SourceCatalog",
name="{fakesType}{coaddName}Diff_psfScoreMatchSources"
)


class AlardLuptonSubtractConnections(SubtractInputConnections, SubtractImageOutputConnections):
Expand Down Expand Up @@ -529,7 +541,8 @@ def runConvolveTemplate(self, template, science, selectSources):
matchedTemplate=matchedTemplate,
matchedScience=science,
backgroundModel=kernelResult.backgroundModel,
psfMatchingKernel=kernelResult.psfMatchingKernel)
psfMatchingKernel=kernelResult.psfMatchingKernel,
kernelSources=kernelSources)

def runConvolveScience(self, template, science, selectSources):
"""Convolve the science image with a PSF-matching kernel and subtract
Expand Down Expand Up @@ -595,7 +608,8 @@ def runConvolveScience(self, template, science, selectSources):
matchedTemplate=matchedTemplate,
matchedScience=matchedScience,
backgroundModel=kernelResult.backgroundModel,
psfMatchingKernel=kernelResult.psfMatchingKernel,)
psfMatchingKernel=kernelResult.psfMatchingKernel,
kernelSources=kernelSources)

def finalize(self, template, science, difference, kernel,
templateMatched=True,
Expand Down Expand Up @@ -1127,7 +1141,8 @@ def runPreconvolve(self, template, science, matchedScience, selectSources, preCo
matchedTemplate=matchedTemplate,
matchedScience=matchedScience,
backgroundModel=kernelResult.backgroundModel,
psfMatchingKernel=kernelResult.psfMatchingKernel)
psfMatchingKernel=kernelResult.psfMatchingKernel,
kernelSources=kernelSources)


def checkTemplateIsSufficient(templateExposure, logger, requiredTemplateFraction=0.,
Expand Down

0 comments on commit 1f67374

Please sign in to comment.