Skip to content

Instantly share code, notes, and snippets.

View jeffjennings's full-sized avatar

Jeff Jennings jeffjennings

View GitHub Profile
@jeffjennings
jeffjennings / rotate_image.py
Last active October 4, 2025 12:37
Rotate a .FITS image to align north to up
""" rotate a .FITS image to align north to up """
from astropy.io import fits
from astropy.wcs import WCS
from reproject.mosaicking import find_optimal_celestial_wcs
from reproject import reproject_exact
def rotate_image(file_in, index, save_output=True):
"""
Rotate a .FITS image to align north to up.