Best way to warp a PSF to match a warped image?

Hello!

I’ve created warped cutouts following the examples in tutorial-notebooks/DP0.2/13a_Image_Cutout_SciDemo.ipynb at main · lsst/tutorial-notebooks · GitHub and would like to warp their corresponding PSFs so they match the new WCS. The warpExposure documentation recommends using WarpedPSF (Class WarpedPsf — LSST Science Pipelines) and I was wondering how to best obtain the inputs for this function. I currently obtain PSFs using, for example info_calexp = img.getInfo() psf_calexp = info_calexp.getPsf() and have the WCS of the warped images using img.getWcs() but am having trouble tracking down how to get the right input formats for WarpedPSF!

Many thanks!

Hi @charlotteaward – thanks for your message. Another community member recently posted an example of using WarpedPsf :

Specifically the lines:

xyTransform = afwGeom.makeWcsPairTransform(template.wcs,calexp.wcs)
warpedPsf = measAlgorithms.WarpedPsf(template.psf, xyTransform)

Does that approach (passing an output from afwGeom.makeWcsPairTransform as an input to WarpedPsf) work for you? Thanks again.

Yes!!! This worked!! Thank you very much :slight_smile:

1 Like