Skip to content

Instantly share code, notes, and snippets.

@davidwhogg
Created July 31, 2012 15:43
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 davidwhogg/3217947 to your computer and use it in GitHub Desktop.
Save davidwhogg/3217947 to your computer and use it in GitHub Desktop.
fits to csv!
import pyfits
import csv
if __name__ == "__main__":
hdulist = pyfits.open("foo.fits")
blob = hdulist[-1].data
with open('foo.csv', 'wb') as f:
writer = csv.writer(f)
writer.writerows(blob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment