2

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.

Wolfgang
  • 329
  • 3
  • 13
  • 4
    That's not really what `Rotation2D` is for. It's not for rotating images. If you want to do image manipulation you should look at dedicated image manipulation routines like https://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.ndimage.interpolation.rotate.html – Iguananaut Dec 21 '16 at 11:15

0 Answers0