Simple Angle Rotation of a FITS File image

4.3k views Asked by At

Using the Astropy function Rotation2D, I have been attempting to rotate an image array (in the form of a fits file) given an angle. My problem is that I do not understand how or where to properly use the inputs. In this case,the inputs would be:

  1. the input array, named im1, and
  2. the angle of rotation, which is 36 degrees.

Here is my code:

import astropy.wcs as wcs
from astropy.modeling.models import Rotation2D
from astropy.io import fits

hdu = fits.open("4imAF.fits")
im1 = hdu[0].data

SkyRotation = Rotation2D.rename('SkyRotation')

Now, from here, I don't know what I can. Something like SkyRotation(im1, '36') will not work, so perhaps I can be enlightened of the correct way to do this.

0

There are 0 answers