Reputation: 41
I have a large number of fits files that I'm unable to open becuase of a missing SIMPLE keyword. When I try to open them using astropy
's fits.open()
it gives the following error:
OSError: No SIMPLE card found, this file does not appear to be a valid FITS file
I tried adding the ignore_missing_simple=True
option to fits.open()
, but this still gives an error:
OSError: Empty or corrupt FITS file
I'm not sure what to do here. My first thought was to edit the fits header to add a SIMPLE
keyword, but if I can't open the file I don't know how to deal with this. I'm wondering if theres more going on than just the missing SIMPLE
keyword given the second error.
If it matters, I've downloaded the fits files, I did not generate them myself.
Upvotes: 3
Views: 2553
Reputation: 11
Which version of astropy are you using? The problem occurs on 4.3, but it works just fine in 4.2.
This GitHub issue reports the problem in the astropy repository.
I propose you downgrade until the issue is fixed.
Upvotes: 1
Reputation: 67
We traced the problem to astropy.io.fits version 4.3 Files generated with version 4.2 can be read with 4.0 or 4.2 but this error pops up with 4.3.1. You could try again after downgrading astropy.io.fits.
Upvotes: 1