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

Marshall Perrin mperrin at stsci.edu
Wed Jun 12 13:06:04 EDT 2013


On Jun 12, 2013, at 12:47 PM, "Eric L. N. Jensen" <ejensen1 at swarthmore.edu> wrote:
> 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.) 

scipy.ndimage.interpolation.rotate
http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.interpolation.rotate.html

The 'reshape' keyword will do the padding you mention. 

One caveat with this is that it can only do rotations about the exact center point of the array. That is often but not always what you want…

 - Marshall

> 
> 
> 
> Thanks in advance for your help with this,
> 
> Eric
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy




More information about the AstroPy mailing list