[AstroPy] Fits file missing END card error when END is present in the header

Indy Leclercq indy.leclercq at manchester.ac.uk
Thu Oct 30 11:39:37 EDT 2014


Hello,

I’ve been processing a batch of similar of FITS files in python using astropy 0.4.2 on Mac OSX 10.9, and on one subset of them (with a header in identical format to the others), fits.open throws an error saying that there is a missing END card in the file. Viewing the header in the terminal shows that the END card is there, and as I said before, the routine works fine on files with essentially the same header.

Could anyone shed some light on this, or is this a weird bug? I can bypass this with the ignore_missing_end kwarg, but still find it weird.

Here are example of working and non-working headers (copied from a terminal more command)

This file opens fine:

SIMPLE  =                    T /  Standard FITS file
BITPIX  =                  -32 /  IEEE 4-byte float
NAXIS   =                    3 /  Number of image dimensions
NAXIS1  =                 5155 /  Size of 1st dimension in pixels
NAXIS2  =                 1070 /  Size of 2nd dimension in pixels
NAXIS3  =                  376 /
OBJECT  = 'GALFACTS_S1 Stokes I'                                  /  Object name
CTYPE1  = 'RA---CAR'           /  1st axis type
CRVAL1  =           102.050003 /  Reference pixel value
CRPIX1  =              2578.00 /  Reference pixel
CDELT1  =           -0.0166667 /  Pixel size in world coordinate units
CROTA1  =               0.0000 /  Axis rotation in degrees
CTYPE2  = 'DEC--CAR'           /  2nd axis type
CRVAL2  =             0.000000 /  Reference pixel value
CRPIX2  =                53.25 /  Reference pixel
CDELT2  =            0.0166667 /  Pixel size in world coordinate units
CROTA2  =               0.0000 /  Axis rotation in degrees
CTYPE3  = 'FREQ'               /  3rd axis type
CRVAL3  =    1524717952.000000 /  Reference pixel value
CRPIX3  =                 1.00 /  Reference pixel
CDELT3  =      -420000.0000000 /  Pixel size in world coordinate units
CROTA3  =               0.0000 /  Axis rotation in degrees
EQUINOX =              2000.00 /  Equinox of coordinates (if any)
BUNIT   = 'Kelvin'                                 /  Units of pixel data values
END


But this one doesn’t:

SIMPLE  =                    T /  Standard FITS file
BITPIX  =                  -32 /  IEEE 4-byte float
NAXIS   =                    3 /  Number of image dimensions
NAXIS1  =                 6000 /  Size of 1st dimension in pixels
NAXIS2  =                 1074 /  Size of 2nd dimension in pixels
NAXIS3  =                  376 /
OBJECT  = 'GALFACTS_N4 Stokes I'                                  /  Object name
CTYPE1  = 'RA---CAR'           /  1st axis type
CRVAL1  =           335.000000 /  Reference pixel value
CRPIX1  =              3000.50 /  Reference pixel
CDELT1  =           -0.0166667 /  Pixel size in world coordinate units
CROTA1  =               0.0000 /  Axis rotation in degrees
CTYPE2  = 'DEC--CAR'           /  2nd axis type
CRVAL2  =             0.000000 /  Reference pixel value
CRPIX2  =             -1181.50 /  Reference pixel
CDELT2  =            0.0166667 /  Pixel size in world coordinate units
CROTA2  =               0.0000 /  Axis rotation in degrees
CTYPE3  = 'FREQ'               /  3rd axis type
CRVAL3  =    1524717952.000000 /  Reference pixel value
CRPIX3  =                 1.00 /  Reference pixel
CDELT3  =      -420000.0000000 /  Pixel size in world coordinate units
CROTA3  =               0.0000 /  Axis rotation in degrees
EQUINOX =              2000.00 /  Equinox of coordinates (if any)
BUNIT   = 'Kelvin'                                 /  Units of pixel data values
END

Thanks for any help you could provide!

Cheers,

Indy
-------------------------------------------------------
Indy Leclercq
Jodrell Bank Centre for Astrophysics
Alan Turing Building, Manchester M13 9PL
indy.leclercq at manchester.ac.uk<mailto:indy.leclercq at manchester.ac.uk>



-------------------------------------------------------
Indy Leclercq
Jodrell Bank Centre for Astrophysics
Alan Turing Building, Manchester M13 9PL
indy.leclercq at manchester.ac.uk<mailto:indy.leclercq at manchester.ac.uk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20141030/06dcfc04/attachment.html>


More information about the AstroPy mailing list