Floating point NaN values as Keywords

Bob Garwood bgarwood at nrao.edu
Mon Aug 11 16:35:13 EDT 1997


Just as it is useful to store NaN (not a number) values in
binary tables to indicate an invalid number, it would be equally
useful to have some convention for indicating a NaN as
a keyword value.

FORTRAN-77 doesn't say anything about NaNs so this would
appear to be not allowed.

Nevertheless, it would be useful.

The only alternative when a certain keyword is expected
to be there is to invent a value that is a lie (which leaves
more than just a bad taste in my mouth) or to not write
that keyword (which leaves someone down the road wondering
if the keyword was left out because it was unknown or some
writer was just sloppy and lost that particular keyword, and
could be a particular problem if some convention requires
that that keyword be present).

In the Single Dish FITS convention that has been firming
up for years (often called the Green Bank convention, at least
in part), columns in a binary table which have a constant
value and which have a name with 8 characters or less can
be represented as keywords (called virtual columns).
Without the ability to write a NaN as a keyword, columns which
are constant NaNs could not be made virtual in this convention.

One data point for consideration:

   Pense's cfitsio library will write out "NaN" when given a
keyword value that is a NaN, at least under Linux and Solaris.


What does anyone else feel about NaN values and keywords?

Cheers,
   Bob Garwood
   bgarwood at nrao.edu




More information about the fitsbits mailing list