[fitsbits] INF/NAN as header values?

Tim Pearson tjp at astro.caltech.edu
Fri Jun 7 15:44:44 EDT 2013


On Jun 7, 2013, at 8:22 AM, Erik Bray wrote:

> 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).

I can think of no use-cases in which it would be appropriate for the value of a FITS header keyword to be Inf: perhaps someone else can? 

There are cases where the value NaN might be appropriate, but in such cases I think it must be better to indicate ignorance by omitting the keyword.

I understand that some programs, given bad data, may sometimes generate Inf or NaN for the value to be attached to a keyword. But this is a case of "garbage in, garbage out" and it doesn't really matter that the resulting file is invalid FITS: you are going to delete it anyway (I hope)!

So I do not think keyword-values Inf and NaN should be added to the FITS standard.

Incidentally, it would be nice if the already-great CFITSIO could be modified to make it impossible to write an invalid FITS file (i.e., one that fails FITSVERIFY), but perhaps that is an unreasonable request.

Thanks,

Tim


Timothy J. Pearson
Caltech







More information about the fitsbits mailing list