Create a gist now

Instantly share code, notes, and snippets.

Embed
Convert Kenny Wood's output images into FITS using Python
# Requires the following Python packages:
#
# - https://pypi.python.org/pypi/fortranfile
# - https://pypi.python.org/pypi/astropy
#
# Ask Tom Robitaille if you need help installing these
from astropy.io import fits
from fortranfile import FortranFile
f = FortranFile('fimage.dat')
image = f.readReals().reshape(200,200)
fits.writeto('fimage.fits', image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment