[fitsbits] ASCII tables, TFORM and recommended practice

Tom McGlynn Thomas.A.McGlynn at nasa.gov
Mon Apr 21 15:40:08 EDT 2003


Since the mailing list seems quiet, I thought I might
ask for recommendations for best practice on an issue
of FITS usage that I find troubling.

As I understand the definition for ASCII tables, the TFORM
keyword describes the Fortran format which is to be used to transform
the string representation into an internal value.  For floating
point numbers this means that a decimal point may be interpolated
in the value if no decimal point is seen in the string, i.e.,
if TFORM='F6.3' and the six characters in the table are '123456', the data
is to be read as 123.456.

This behavior is perfectly well defined, but I think it's probably
bad practice to use it today.  The tiny savings in space just
don't seem worth the potential confusion to users.  Thus whenever
I create a floating point column I set TFORM='Fnn.0'.  Then I just
write out numbers with an explicit decimal point or exponent. Since these
override what is specified in the format, this works fine in all cases.
Users are not confused by invisible decimal points.  There's no
chance of a user modifying a field and entering a value that doesn't
have an explicit decimal which is then interpreted entirely differently than
anticipated (perhaps using a text editor or their own simple FITS software).

My question is basically what do others think on this issue?

The problem with my solution is that packages which use the TFORM
to decide the precision for display may be fooled.  At least one
recognizes the TDISP keyword, but that's actually defined for
binary tables not ASCII.  My feeling is that since the actual decimal in the
string overrides the one specified in the TFORM, it is the responsibility
of the display software to look at what is actually there but some does
not.  I'm doubt is a perfect solution, but what is the best practice here?

	Regards,

	Tom McGlynn




More information about the fitsbits mailing list