[AstroPy] Rotating a FITS image (or just its WCS)

Eric L. N. Jensen ejensen1 at swarthmore.edu
Wed Jun 12 12:47:50 EDT 2013


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,

Eric
 


More information about the AstroPy mailing list