[AstroPy] PyFits not reading END value from header?
Gerard Fitzpatrick
Gerard.Fitzpatrick at ucdconnect.ie
Mon Apr 4 18:48:28 EDT 2011
Hello all,
I've run into a small problem with pyfits. I am not sure if this is a problem or simply down to my ignorance!
I am reading in a header and table data from one file, then appending it to another. The code throws an error: IOError: Header missing END card. I can print the header and see that it is missing the End value. I have tried this on three different fits files and continually run into the same problem, this leads me to suspect that there is a subtlety that I am missing.
I am using version 2.3.1 on ubuntu 10.10
The code is something like this:
import pyfits as pf
file='blah.fits'
fits_file=pf.open(file)
hdr_1=fits_file[1].header
table_1=fits_file[1].data
fits_file.close()
pf.update('test.fits',table_1,hdr_1)
In place of pf.update I have also tried pf.append & pf.writeto.
Regards,
G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20110404/155ae3f7/attachment.html>
More information about the AstroPy
mailing list