[LSST|dm-users 673] Re: Using GalSim PSF's with DM Stack
Will Dawson
will at dawsonresearch.com
Fri May 22 16:03:31 PDT 2015
K-T,
That worked like a charm. Thank you for the quick response.
Regards,
Will
> On May 22, 2015, at 3:54 PM, Kian-Tat Lim <ktl at slac.stanford.edu> wrote:
>
> 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