Open dstndstn opened 3 years ago
I haven't looked at the internals lately, but I think the Astropy implementation of the FITS header object is a subclass of dict
(or similar), which is incorrect. It's perfectly valid, as you see, for FITS headers to have duplicate keywords, unlike dictionaries. It may be something related to this?
Hi Erin,
With fitsio 1.1.4 (and python 3.8.10), I'm trying to read an image header from the Canada-France-Hawaii Telescope's MegaPrime camera, and I'm getting weird behavior.
There are a couple of weird things with these images. First, each image HDU contains two EXTNAME cards, one
and one
And it also contains some header cards like
The weird thing is that I can create a
FITS
object and read its headers by index, butfitsio.read_header
fails!This works:
but this fails:
and (oddly?) if I run those in sequence, I get more log messages:
Now, if I edit the header and change the first EXTNAME card to XXTNAME, then it works correctly!
I'm honestly not sure if this is something that fitsio should reasonably be expected to deal with, so feel free to close. For what it's worth, astropy seems to choke on it as well (even the fixed version).