Look at ImageAligner.image_source_warped_to_target ; there are some comments there.
Right now the Image database entry for the warped image is made by copying the source image's entry, but then pasting in the ra/dec and four corners fields from the target entry. This is right as far as it goes, but we need to make sure that everything else is right too.
The WCS for the warped image should be the same as the target image, assuming the target image had a decently astrometrically calibrated WCS.
Depending on what goes into the "info" field from the header, some things could be more complicated. Any WCS info should be that of the target image, not the source image. Any size information (what are the NAXIS* keywords in FITS files) should be those of the target image, not the source image.
As of this writing, the Image model doesn't directly store anything about the shape of the image (the size information mentioned in the previous bullet point); the only place it might be is the info field. If that's ever added, then we have to make sure it's done right for warped images, as copying the source image's values may well be the wrong thing to do.
[[ Perhaps out of scope for this issue: PSFs should be remeasured (if they aren't already). The spatial variation of the PSF from the source image will now be wrong, because pixels have shifted. the PSF may also be slightly modified because of the blurring effect of resampling pixels. ]] ← this already happens in ImageAligner._align_swarp
Look at ImageAligner.image_source_warped_to_target ; there are some comments there.
Right now the Image database entry for the warped image is made by copying the source image's entry, but then pasting in the ra/dec and four corners fields from the target entry. This is right as far as it goes, but we need to make sure that everything else is right too.
The WCS for the warped image should be the same as the target image, assuming the target image had a decently astrometrically calibrated WCS.
Depending on what goes into the "info" field from the header, some things could be more complicated. Any WCS info should be that of the target image, not the source image. Any size information (what are the NAXIS* keywords in FITS files) should be those of the target image, not the source image.
As of this writing, the Image model doesn't directly store anything about the shape of the image (the size information mentioned in the previous bullet point); the only place it might be is the info field. If that's ever added, then we have to make sure it's done right for warped images, as copying the source image's values may well be the wrong thing to do.
[[ Perhaps out of scope for this issue: PSFs should be remeasured (if they aren't already). The spatial variation of the PSF from the source image will now be wrong, because pixels have shifted. the PSF may also be slightly modified because of the blurring effect of resampling pixels. ]] ← this already happens in
ImageAligner._align_swarp