65 def run(self, exposure):
66 """Set exposure's PSF to a simple PSF model
68 The sigma and width of the new simple PSF model matches the sigma and
69 width of the current model, if any, else the config parameters are used.
73 exposure : `lsst.afw.image.Exposure`
74 Exposure in which to replace or add the PSF model.
77 psfModel = exposure.getPsf()
78 psfSigma = psfModel.computeShape(psfModel.getAveragePosition()).getDeterminantRadius()
79 width, height = psfModel.computeImage(psfModel.getAveragePosition()).getDimensions()
81 psfSigma = self.config.fwhm / FwhmPerSigma
82 width = height = self.config.width
85 raise RuntimeError(
"psfSigma = %s <= 0" % (psfSigma,))
87 self.log.debug(
"installing a simple Gaussian PSF model with width=%s, height=%s, FWHM=%0.3f",
88 width, height, psfSigma*FwhmPerSigma)
90 exposure.setPsf(psfModel)