[LSST|dm-users 671] Re: Using GalSim PSF's with DM Stack
Kian-Tat Lim
ktl at slac.stanford.edu
Fri May 22 15:54:18 PDT 2015
Will,
> So in an attempt to add a PSF to the GalSim postage stamp exposure, I first output the PSF that I used to generate the GalSim postage stamp as a fits file. Note that this is a fits image of a normalized PSF that this has them same pixel scale as the image. Jim suggested that then use afw.math.FixedKernel() and then create a KernelPSF from the FixedKernel, but I am not sure how to do this and my naive attempts have failed.
I think you want to do this:
import lsst.afw.math as afwMath
import lsst.afw.image as afwImage
import lsst.meas.algorithms as measAlg
psf = measAlg.KernelPsf(afwMath.FixedKernel(afwImage.ImageD('psf_fits_file.fits')))
exposure.setPsf(psf)
Note that kernels apparently have to have double-precision
pixels (the D in "ImageD").
--
Kian-Tat Lim, LSST Data Management, ktl at slac.stanford.edu
More information about the dm-users
mailing list