Skip to content

Instantly share code, notes, and snippets.

@astrofrog
Created August 18, 2013 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrofrog/6264285 to your computer and use it in GitHub Desktop.
Save astrofrog/6264285 to your computer and use it in GitHub Desktop.
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