[AstroPy] Fixing broken FITS headers

Russell Owen rowen at uw.edu
Thu Aug 18 18:53:46 EDT 2016


I will push back gently on this. Where practical it is best to be liberal in what you read, though of course the code should always write correct files.

— Russell

> On Aug 18, 2016, at 3:46 PM, John K. Parejko <parejkoj at uw.edu> wrote:
> 
> We should not expect our FITS readers to behave correctly when given invalid files. The fact that those files were handled ok in astropy under python2.7 was due entirely to luck. Yes, there are many badly formatted FITS files out in the wild, but that's not the fault of astropy.io.fits.
> 
> John
> 
> On 18Aug 2016, at 15:18, Xavier Gnata <xavier.gnata at gmail.com> wrote:
> 
>>> On Aug 17, 2016, at 10:50 AM, Derek Homeier <derek at astro.physik.uni-goettingen.de> wrote:
>>> 
>>>> If it is not a large number of files, you might simply edit the headers with ‘vi -b’ and, as Demitri
>>>> noted, make sure to replace each umlaut with two ASCII chars.
>>> 
>>> Nice tip! If you resize your terminal window to display 80 characters in width it will be pretty obvious what kind of padding is needed.
>>> 
>>> Demitri
>> 
>> 
>> I faced the same issue some months ago and I fixed it with a small python *script*. I found it already pretty disgusting.
>> Using an editor to fix our data is against most of the best practices when it comes to data handling.
>> fitsio with pyhon3 is *broken*. It use to be ok with python2.7.
>> Ok, these files are not following the standard. However, io.fits was able to open them without a warning with python2.7. That's bad but that's to late to change that. A fair amount of data has been produced that way. We need to be able to read then again with up to date means.
>> It does work anymore with python3 (8 years after the first python3 release). That's not what one can expect from an io lib and from such a widely used scientific data format.
>> I hope it will  be fixed asap.
>> 
>> Xavier
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> https://mail.scipy.org/mailman/listinfo/astropy
> 
> --
> *************************
> John Parejko
> parejkoj at uw.edu
> http://staff.washington.edu/parejkoj/
> Department of Physics and Astronomy
> University of Washington
> Seattle, WA
> **************************
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy




More information about the AstroPy mailing list