How to coadd with Psf matching

Coadding a set of exposures with Psf matching is failing with the following error message : “ERROR: Dimensions of reference Psf and science Psf different”. Is it possible (and does it make sense) to force the kernel size to be the same for every contributing exposure ?

I don’t recommend using PSF matching at the moment, because it doesn’t really match PSFs. In the code, the order of operations has long been switched (match input image to target PSF, then warp) from what is correct (it was a simple but wrong way to do it).

If you insist on doing it, you’ll need to mention what Psf you’re using. If it’s PcaPsf, then I expect the size varies for each exposure (which is not unreasonable — the seeing varies). Requiring them to be equal is probably a bug in the PSF matcher. As a workaround, you could try setting config.calib.measurePsf.psfDeterminer[“pca”].kernelSizeMin and kernelSizeMax to the same number.

1 Like

@price I’m interested in doing this too. I’m happy to look into warping then matching, but it seems reasonable to do this the wrong way around first to make headway on end to end processing of various datasets. I know we successfully matched PSFs when we coadded the SDSS data, so it seems like is should be possible. I’ll try out setting the min and max kernel sizes to be the same in the calib step.

I looked at this a bit. It just compares the size of the reference kernel to the science kernel and raises if they are not equal. I’m assuming the smaller could be padded out to the size of the larger.