next up previous contents index
Next: 8.2 Image Extension Up: 8.1 The ASCII Table Previous: 8.1.4 Fields

8.1.5 Entries

  All data in an ASCII table extension field shall be ASCII text  in a format that conforms to the rules for fixed field input in ANSI FORTRAN-77  [13] format, as described below, including implicit decimal points. The only possible formats shall be those specified in Table 8.2. If values of -0 and +0 must be distinguished, then the sign character  should appear in a separate field in character format. TNULLn keywords  may be used to specify a character string that represents  an undefined value in each field. The characters representing an undefined value may differ from field to field but must be the same within a field. Writers of ASCII tables should select a format appropriate to the form, range of values, and accuracy of the data in the table.

The value of a character-formatted (Aw) field is a character string of width w containing the characters in columns TBCOLn through TBCOLn+w-1 .

The value of an integer-formatted (Iw) field is an integer number determined by removing all blanks from columns TBCOLn through TBCOLn+w-1 and interpreting the remaining, right-justified characters as a signed decimal integer. A blank field has value 0. All characters other than blanks, the decimal integers (``0'' through ``9'') and a single leading sign character (``+'' and ``-'') are forbidden.

The value of a real-formatted field (Fw.d, Ew.d, Dw.d) is a real number determined from the w characters from columns TBCOLn through TBCOLn+w-1. The value is formed by

1.
discarding all blank characters and right-justifying the non-blank characters,
2.
interpreting the first non-blank characters as a numeric string consisting of a single optional sign (``+'' or ``-'') followed by one or more decimal digits (``0'' through ``9'') optionally containing a single decimal point (``.''). The numeric string is terminated by the end of the right-justified field or by the occurrence of any character other than a decimal point (``.'') and the decimal integers (``0'' through ``9''). If the string contains no explicit decimal point, then the implicit decimal point is taken as immediately preceding the rightmost d digits of the string, with leading zeros assumed if necessary.
3.
if the numeric string is terminated by a
(a)
``+'' or ``-'', interpreting the following string as an exponent in the form of a signed decimal integer, or
(b)
``E'', or ``D'', interpreting the following string as an exponent of the form E or D followed by an optionally signed decimal integer constant.
4.
The exponent string, if present, is terminated by the end of the right-justified string.
5.
Characters other than those specified above are forbidden.
The numeric value of the table field is then the value of the numeric string multiplied by ten (10) to the power of the exponent string, i.e., value = numeric_string × 10(exponent_string). The default exponent is zero and a blankfield has value zero. There is no difference between the F, D, and E formats; the content of the string determines its interpretation. Numbers requiring more precision and/or range than the local computer can support may be represented. It is good form to specify a D format in TFORMn for a column of an ASCII table when that column will contain numbers that cannot be accurately represented in 32-bit IEEE binary format (see Appendix H).

Note that the above definitions allow for embedded blanks anywhere in integer-formatted and real-formatted fields and implicit decimal points in real-formatted fields. FITS reading tasks will have to honor these flexibilities. However, since these flexibilities are likely to cause confusion and possible misinterpretation, it is recommended that FITS writing tasks write tables with explicit decimal points and no embedded or trailing blanks whenever possible.


next up previous contents index
Next: 8.2 Image Extension Up: 8.1 The ASCII Table Previous: 8.1.4 Fields

5/13/1999