Skip to content

Commit

Permalink
ModelPsfMatchTask: Set output exposure PSF to model PSF used
Browse files Browse the repository at this point in the history
Remove referenceModelPsf from returned Struct, because it is
now accessible from the psfMatchedExposure.
  • Loading branch information
yalsayyad committed Mar 31, 2017
1 parent ab7f4cf commit 62a3b6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/lsst/ip/diffim/modelPsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def run(self, exposure, referencePsfModel, kernelSum=1.0):
psfMatchedExposure = afwImage.ExposureF(exposure.getBBox(), exposure.getWcs())
psfMatchedExposure.setFilter(exposure.getFilter())
psfMatchedExposure.setCalib(exposure.getCalib())
psfMatchedExposure.setPsf(referencePsfModel)
psfMatchedMaskedImage = psfMatchedExposure.getMaskedImage()

# Normalize the psf-matching kernel while convolving since its magnitude is meaningless
Expand All @@ -312,7 +313,6 @@ def run(self, exposure, referencePsfModel, kernelSum=1.0):
psfMatchingKernel=psfMatchingKernel,
kernelCellSet=kernelCellSet,
metadata=self.metadata,
referencePsfModel=referencePsfModel,
)

def _diagnostic(self, kernelCellSet, spatialSolution, spatialKernel, spatialBg):
Expand Down
4 changes: 2 additions & 2 deletions tests/testModelPsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def testAdjustModelSize(self):
psfModel = measAlg.DoubleGaussianPsf(self.ksize + 2, self.ksize + 2, self.sigma2)
psfMatch = ipDiffim.ModelPsfMatchTask(config=self.config)
results = psfMatch.run(self.exp, psfModel)
self.assertEqual(results.referencePsfModel.computeImage().getDimensions(),
self.assertEqual(results.psfMatchedExposure.getPsf().computeImage().getDimensions(),
self.exp.getPsf().computeImage().getDimensions())
self.assertEqual(results.referencePsfModel.getSigma1(), self.sigma2)
self.assertEqual(results.psfMatchedExposure.getPsf().getSigma1(), self.sigma2)

def tearDown(self):
del self.exp
Expand Down

0 comments on commit 62a3b6c

Please sign in to comment.