[AstroPy] Rotating a FITS image (or just its WCS)
Wed Jun 12 12:06:00 CDT 2013
I don't know if you'd call it "straightforward", but the usual technique is resampling the image. Resampling correlates noise and either smears the image (if you use a low-order resampling kernel) or adds ringing around sharp features (if you use a high-order kernel).
SExtractor can do this easily and quickly (so can the LSST software stack, and I'm sure there are other options). You will need to generate the desired new WCS.
On Jun 12, 2013, at 9:47 AM, "Eric L. N. Jensen" <firstname.lastname@example.org> wrote:
> Hi all,
> I'm creating some model disk images which are computationally intensive. It occurs to me that, for one of my parameters, the position angle of the disk projected on the sky, there is no need to recompute an image each time, as the image at different PAs is just a rotated version of the same image at zero PA.
> So I'd like to be able to take an existing FITS image, with WCS info in the header, and either keep the WCS the same while rotating the image pixels, or simply modify the image WCS to indicate a rotated reference frame for the image, to be interpreted by CASA when it reads the image.
> My first approach was to simply add a rotation matrix to the FITS header, using the PC_i_j keywords that specify the image's rotation; ds9 viewed the image OK, but it appears that this is not supported by CASA.
> So, I'm wondering about rotating the image itself and leaving the WCS unchanged. So, is there a straightforward way to rotate an image by an arbitrary angle? (Ideally with handling things like padding the image so it remains rectangular.)
> Thanks in advance for your help with this,
More information about the AstroPy