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

David Berry d.berry@jach.hawaii....
Wed Jun 12 12:09:48 CDT 2013


On 12 June 2013 17:47, Eric L. N. Jensen <ejensen1@swarthmore.edu> 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.

Have you tried using CDi_j instead of PCi_j? Or even good ol' CROTAi ?

CASA must surely upport some way of rating an image, so it's got to be
PCi_j, CDi_j or CROTA...

David

>
> 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
>
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy


More information about the AstroPy mailing list