[fitsbits] INF/NAN as header values?
Thierry Forveille
Thierry.Forveille at obs.ujf-grenoble.fr
Fri Jun 7 12:33:18 EDT 2013
Quoting Erik Bray <embray at stsci.edu>:
> I originally sent this message a few months ago and never got any
> replies. Now
> based on recent activity I'm thinking maybe the mailinglist was
> having issues?
> So trying again. Apologies if this is a duplicate.
>
I don't think I ever saw the first posting, so your resending
is welcome.
> I've had a few different issues reported against PyFITS lately
> regarding INF/NaN
> as values in FITS headers (that is, as float literals, without
> quotation marks
> around them).
>
> In particular, reading files that contain values like this fails in
> PyFITS, and
> writing those values to a header currently has undefined behavior
> (though upon
> writing to disk the header is reported as invalid). And according
> to a strict
> reading of the current FITS standard, specifically section 4.2.4, this is
> correct: INF and NaN are not valid formats for header values.
>
> I have a suspicion that this was at one time intentional--not all systems may
> have had representations for those values in their floating point
> implementations. But by today's standards it feels like an
> oversight. It was
> pointed out to me that IDL allows saving INF/NaN as header values,
> but the way
> it writes them violates the FITS standard. But several such files
> appear to be
> present in the wild, so I'm considering going and letting PyFITS
> allow this too.
>
Do you have information on the origin(s) of the offending files? In case
a single software package wrote all of them and is not in very widespread
use, we can discuss the issue on its merit and could potentially decree that
it's their bug and that they should fix it. If, on the other hand, half a
dozen packages do that and thousands of files exist in the wild, then
I'd say that the cat is out of the bag and we have no choice but adapt
to reality.
Thierry
More information about the fitsbits
mailing list