next previous
Up: Definition of the Flexible (FITS)


Subsections

   
8 Standard extensions

   
8.1 The ASCII table extension

Data  shall  appear as an ASCII table   extension if the primary header of the FITS file has the keyword  EXTEND set  to T and the first keyword of that extension  header has XTENSION= \includegraphics[width=3mm,clip]{espace.eps}'TABLE \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps}'.

   
8.1.1 Mandatory keywords

The header of an ASCII table extension must use the keywords defined in Table 5. The  first keyword must be XTENSION; the seven keywords following XTENSION (BITPIX ... TFIELDS) must be in the order   specified with no intervening keywords.
 

 
Table 5: Mandatory keywords in ASCII table extensions.
1 XTENSION
2 BITPIX
3 NAXIS
4 NAXIS1
5 NAXIS2
6 PCOUNT
7 GCOUNT
8 TFIELDS
   
  (other keywords, which must include ...)
  TBCOLn, n=1, 2, ..., k where k is the value
                                            of TFIELDS
  TFORMn, n=1, 2, ..., k where k is the value
                                            of TFIELDS

 
last END


XTENSION keyword.

The  value field shall contain the character  string value text 'IMAGE \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps}'

BITPIX keyword.

The value field shall contain the integer 8, denoting  that the array contains ASCII  characters.

NAXIS keyword.

The value field shall contain the integer 2, denoting  that the included data array is two-dimensional: rows and columns.

NAXIS1 keyword.

The value field shall contain a non-negative integer, giving  the number of ASCII characters in each row of the table.

NAXIS2 keyword.

The value field shall contain a non-negative integer, giving  the number of rows in the table.

PCOUNT keyword.

The value field shall contain the integer 0. 

GCOUNT keyword.

The value field shall contain the integer 1; the data  records contain a single table.

TFIELDS keyword.

The value field shall contain a non-negative integer representing  the number of fields in each row. The maximum permissible value is 999.

TBCOLn keywords.

The value field of this indexed keyword shall contain an integer  specifying the column in which field n starts. The first column of a row is numbered 1.

TFORMn keywords.

The value field of this indexed keyword  shall contain a character string describing the format in which field n is encoded. Only the formats  in Table 6, interpreted as ANSI FORTRAN-77 (ANSI 1978) input  formats and discussed in more detail in Sect. 8.1.5, are permitted for encoding. Format codes must be specified in upper case. Other format editing codes common to ANSI FORTRAN-77 such as repetition, positional editing, scaling, and field termination are not permitted. All values in numeric fields have a number base of ten (i.e., they are decimal); binary, octal, hexadecimal, and other representations are not permitted.


 

 
Table 6: Valid TFORMn format values in TABLE extensions.
Field Value Data Type
Aw Character
Iw Decimal integer
Fw.d Single precision real
Ew.d Single precision real, exponential notation
Dw.d Double precision real, exponential notation


END keyword.

This keyword has no associated value. Columns 9-80  shall contain ASCII blanks.

   
8.1.2 Other reserved keywords

In  addition to the mandatory keywords defined in Sect. 8.1.1, the following keywords may be used to describe the structure of an ASCII table data array. They are optional, but if they appear within an ASCII table extension header, they must be used as defined in this section of this standard.

TSCALn keywords.

This indexed keyword shall be used, along with the TZEROn keyword, when the quantity in field n does not  represent a true physical quantity. The value field shall contain a floating point number representing the coefficient of the linear term in Eq. (7), which must be used to compute the true physical value  of the field. The default value for this keyword is 1.0. This keyword may not be used for A-format fields.

TZEROn keywords.

This indexed keyword shall be used, along with the TSCALn keyword, when the quantity in field n does not represent a true  physical quantity. The value field shall contain a floating point number representing the zero point for the true physical value of field n. The default value for this keyword is 0.0. This keyword may not be used for A-format fields.

The transformation equation used to compute a true physical value from the quantity in field n is 

 
$\displaystyle \mbox{\small physical\_value}\small $=$\displaystyle \mbox{\small {\tt TZEROn}} + \mbox{\small {\tt TSCALn}}
\times \mbox{\small field\_value}.$ (7)

TNULLn keywords.

The value field for this indexed keyword shall contain the character  string that represents  an undefined value for field n. The string is implicitly blank filled  to the width of the field.

TTYPEn keywords.

The value field for this indexed keyword shall contain a  character string, giving the name of field n. It is recommended that only letters, digits, and underscore  (hexadecimal code 5F, "_'') be used in the name. String comparisons with the values of TTYPEn keywords should not be case sensitive. The use of identical names for different fields should be avoided.

TUNITn keywords.

The value field shall contain a character string  describing the physical units  in which the quantity in field n, after any application  of TSCALn and TZEROn, is  expressed. Units must follow the prescriptions in Sect. 5.3.

8.1.3 Data sequence

The table is constructed from a two-dimensional array of ASCII  characters. The row length and the number of rows shall be those specified, respectively, by the NAXIS1  and NAXIS2  keywords of the associated header records. The number of characters in a row and the number of rows in the table shall determine the size of the character array. Every row in the array shall have the same number of characters. The first character of the first row shall be at the start of the record immediately following the last header record. The first character of subsequent rows shall follow immediately the character at the end of the previous row, independent of the record structure. The positions in the last data record after the last character of the last row of the data array shall be filled  with ASCII blanks.

8.1.4 Fields

Each row in the array shall consist of a sequence of fields, with one entry in each field. For every field, the ANSI FORTRAN-77 format  of the information contained, location in the row of the beginning of the field and (optionally) the field name, shall be specified in keywords of the associated header records. A separate format keyword must be provided for each field. The location and format of fields shall be the same for every row. Fields may overlap. There may be characters in a table row that are not included in any field.

   
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  (ANSI 1978) format, as described below, including implicit decimal points. The only possible formats shall be those specified in Table 6. 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 $ + {\tt w} - 1$. The value of an integer-formatted (Iw) field is an integer number determined by removing all blanks from columns TBCOLn through TBCOLn $ + {\tt 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 $ + {\tt 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 $\times$ $10^{\rm (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 .15). 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.

   
8.2 Image extension

Data  shall  appear as an image  extension if the primary header of the FITS file has the keyword EXTEND set  to T and the first keyword of that extension  header  has
XTENSION= \includegraphics[width=3mm,clip]{espace.eps}' IMAGE+ \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps}'.

   
8.2.1 Mandatory keywords

The XTENSION keyword is required to be the first keyword of all image extensions. The  card images in the header of an image extension must use the keywords defined in Table 7 in the order specified. No other keywords may intervene between the XTENSION and GCOUNT keywords.
 

 
Table 7: Mandatory keywords in image extensions.
1 XTENSION
2 BITPIX
3 NAXIS
4 NAXISn, n = 1, ..., NAXIS
5 PCOUNT
6 GCOUNT
   
  (other keywords ...)
   
last END


XTENSION keyword.

The  value field shall contain the character  string value text 'IMAGE \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps} \includegraphics[width=3mm,clip]{espace.eps}'.

BITPIX keyword.

The value field shall contain an integer. The  absolute value is used in computing the sizes of data structures. It shall specify the number of bits that represent a data value. The only valid values of BITPIX are given in Table 2.

NAXIS keyword.

The value field shall contain a non-negative integer no greater than 999, representing the number of axes in the associated data  array. A value of zero signifies that no data follow the header in the image  extension.

   
NAXISn keywords.

The value field of this indexed keyword shall contain a non-negative integer, representing the number of elements along axis n of a data array. The NAXISn must be present for all values n = 1, ..., NAXIS, and for no other values of n. A value of zero for any of the NAXISn signifies that no data follow the header in the  image extension. If NAXIS is equal to 0, there should not be any NAXISn   keywords.

PCOUNT keyword.

The value field shall contain the integer 0. 

GCOUNT keyword.

The value field shall contain the integer 1; each  image extension contains a single array.

END keyword.

This keyword has no associated value. Columns 9-80  shall be filled with ASCII blanks.

8.2.2 Units

The units  of all header keyword values in an image  extension shall follow the prescriptions in Sect. 5.3.

8.2.3 Data sequence

The data format shall be identical to that of a primary data array as  described in Sect. 4.3.2.

   
8.3 Binary table extension

Data  shall  appear as a binary table  extension if the primary header of the FITS file has the keyword  EXTEND set  to T and the first keyword of that extension  header has XTENSION= \includegraphics[width=3mm,clip]{espace.eps}' BINTABLE'.

   
8.3.1 Mandatory keywords

The XTENSION keyword is the first keyword of all binary table extensions. The seven keywords  following (BITPIX ...TFIELDS) must be in the order specified in Table 8, with no intervening keywords.


 

 
Table 8: Mandatory keywords in binary table extensions.
1 XTENSION
2 BITPIX
3 NAXIS
4 NAXIS1
5 NAXIS2

6

PCOUNT
7 GCOUNT
8 TFIELDS
   
  (other keywords, which must include ...)
  TFORMn, n=1, 2, ..., k where k is the value
                                            of TFIELDS
   
last END


XTENSION keyword.

The  value field shall contain the character  string 'BINTABLE'.

BITPIX keyword.

The value field shall contain the integer 8, denoting  that the array is an array of 8-bit bytes.

NAXIS keyword.

The value field shall contain the integer 2, denoting  that the included data array is two-dimensional: rows and columns.

NAXIS1 keyword.

The value field shall contain a non-negative integer, giving  the number of 8-bit bytes in each row of the table.

NAXIS2 keyword.

The value field shall contain a non-negative integer, giving  the number of rows in the table.

PCOUNT keyword.

The value field  shall contain the number of bytes that follow the table in the associated extension data.

GCOUNT keyword.

The value field shall contain the integer 1; the data  records contain a single table.

TFIELDS keyword.

The value field shall contain a non-negative integer representing  the number of fields in each row. The maximum permissible value is 999.

TFORMn keywords.

The value field of this indexed keyword shall contain a  character string of the form rTa. The repeat count r is  the ASCII representation of a non-negative integer specifying the number of elements in field n. The default value of r is 1; the repeat count need not be present if it has the default value. A zero element count, indicating an empty  field, is permitted. The data type T specifies the data type of the contents of field n. Only the data types in Table 9 are permitted. The format codes must be specified in upper case. For fields of type P, the only permitted repeat counts are 0 and 1. The additional characters a are optional and are not further defined in this standard. Table 9 lists the number of bytes each data type occupies in a table row. The first field of a row is numbered 1. The total number of bytes $n_{\rm row}$ in a table row, given by
 
$\displaystyle \small n_{\rm row} = \sum_{i=1}^{\mbox{\tt TFIELDS}} {r_{i} b_{i}}$     (8)

where ri is the repeat count for field i, bi is the number of bytes for the data type in field i, and TFIELDS is the value of that keyword, must equal the value of  NAXIS1.


 

 
Table 9: Valid TFORMn data types in BINTABLE extensions.
TFORMn   8-bit
value Description Bytes
L Logical 1
X Bit *
B Unsigned byte 1
I 16-bit integer 2
J 32-bit integer 4
A Character 1
E Single precision floating point 4
D Double precision floating point 8
C Single precision complex 8
M Double precision complex 16
P Array Descriptor 8

* Number of 8-bit bytes needed to contain all bits.


END keyword.

This keyword has no associated value. Columns 9-80  shall contain ASCII blanks.

   
8.3.2 Other reserved keywords

In  addition to the mandatory keywords defined in Sect. 8.3.1, these keywords may be used to describe the structure of a binary table data array. They are optional, but if they appear within a binary table extension header, they must be used as defined in this section of this standard.

TTYPEn keywords.

The value field for this indexed keyword shall contain a  character string, giving the name of field n. It is recommended that only letters, digits, and underscore (hexadecimal code 5F, "_'') be used in the name. String comparisons with the values of TTYPEn keywords should not be case sensitive. The use of identical names for different fields should be avoided.

TUNITn keywords.

The value field shall contain a character string  describing the physical units  in which the quantity in field n, after any application  of TSCALn and TZEROn, is  expressed. Units must follow the prescriptions in Sect. 5.3.

TNULLn keywords.

The value field for this indexed keyword shall contain the integer  that represents  an undefined value for field n of data type B, I, or J. The keyword may not be used if field n is of any other data type.

TSCALn keywords.

This indexed keyword shall be used, along with the TZEROn keyword, when the quantity in field n does not  represent a true physical quantity. It may not be used if the format of field n is A, L, or X. The interpretation for fields of type P is not defined. A proposed interpretation is described in Appendix .3. For fields with all other data types, the value field shall contain a floating point number representing the coefficient of the linear term in Eq. (7), which is used to compute the true physical value  of the field, or, in the case of the complex data types C and M, of the real part of the field, with the imaginary part of the scaling factor set to zero. The default value for this keyword is 1.0.

TZEROn keywords.

This indexed keyword shall be used, along with the TSCALn keyword, when the quantity in field n does not  represent a true physical quantity. It may not be used if the format of field n is A, L, or X. The interpretation for fields of type P is not defined. A proposed interpretation is described in Appendix .3. For fields with all other data types, the value field shall contain a floating point number representing the true physical value corresponding to a value of zero in field n of the FITS file, or, in the case of the complex data types C and M, in the real part of the field, with the imaginary part set to zero. The default value for this keyword is 0.0. Equation (7) is used to compute  a true physical value from the quantity in field n.

TDISPn keywords.

The value field of this indexed keyword shall contain a  character string describing the format recommended for the display of the contents of field n. If the table value has been scaled, the physical value, derived using Eq. (7), shall be displayed. All elements in a field shall be displayed with a single, repeated format. For purposes of display, each byte of bit (type X) and byte (type B) arrays is treated a an unsigned integer. Arrays of type A may be terminated with a zero byte. Only the format codes in Table 10, discussed in Sect. 8.3.4, are permitted for encoding. The format codes must be specified in upper case. If the Bw.m, Ow.m, and Zw.m formats are not readily available to the reader, the Iw.m display format may be used instead, and if the ENw.d and ESw.d formats are not available, Ew.d may be used. The meaning of this keyword is not defined for fields of type P in this standard but may be defined in conventions using such fields.


 

 
Table 10: Valid TDISPn format values in BINTABLE extensions. w is the width in characters of displayed values, m is the minimum number of digits displayed, d is the number of digits to right of decimal, and e is number of digits in exponent. The .m and Ee fields are optional.
Field Value Data Type
Aw Character
Lw Logical
Iw.m Integer
Bw.m Binary, integers only
Ow.m Octal, integers only
Zw.m Hexadecimal, integers only
Fw.d Single precision real
Ew.dEe Single precision real, exponential notation
ENw.d Engineering; E format with exponent multiple of 3
ESw.d Scientific; same as EN but nonzero leading digit if not zero
Gw.dEe General; appears as F if significance not lost, else E.
Dw.dEe Double precision real, exponential notation


THEAP keyword.

The value field of this  keyword shall contain an integer providing the separation, in bytes, between the start of the main data table and the start of a supplemental data area called the  heap. The default value shall be the product  of the values of NAXIS1 and  NAXIS2. This keyword shall not be used if the value of PCOUNT is zero. A proposed application of this keyword is presented in Appendix .3.

TDIMn keywords.

The value field of this  indexed keyword shall contain a character string describing how to interpret the contents of field n as a multidimensional array, providing the number of dimensions and the length along each axis. The form of the value is not further specified by this standard. A proposed convention is described in Appendix .4.

   
8.3.3 Data sequence

The data in a binary table extension shall consist of a Main Data Table which may, but need not, be followed by additional bytes. The positions in the last data record after the last additional byte, or, if there are no additional bytes, the last character of the last row of the data array, shall be filled  by setting all bits to zero.

   
8.3.3.1. Main data table.

The table is constructed from a two-dimensional byte array. The number of bytes in a row shall be specified by the value of the NAXIS1  keyword and the number of rows shall be specified by the NAXIS2  keyword of the associated header records. Within a row, fields shall be stored in order of increasing column number, as determined from the n of the TFORMn keywords. The number of bytes in a row and the number of rows in the table shall determine the size of the byte array. Every row in the array shall have the same number of bytes. The first row shall begin at the start of the record immediately following the last header record. Subsequent rows shall begin immediately following the end of the previous row, with no intervening bytes, independent of the record structure. Words need not be aligned along word boundaries. Each row in the array shall consist of a sequence of fields. The number of elements in each field and their data type shall be specified in keywords of the associated header records. A separate format keyword must be provided for each field. The location and format of fields shall be the same for every row. Fields may be  empty, if the repeat count  specified in the value of the TFORMn keyword of the header is 0. The following data types, and no others, are permitted.

Logical.

If  the value of the TFORMn keyword specifies data type L, the contents of field n shall consist of ASCII T indicating true or ASCII F, indicating false. A 0 byte (hexadecimal 0) indicates an invalid value.

Bit array.

If the value of the TFORMn keyword specifies data type X, the contents of field n shall consist of a sequence of bits starting with the most significant bit; the bits following shall be in order of decreasing significance, ending with the least significant bit. A bit array shall be composed of an integral number of bytes, with those bits following the end of the data set to zero. No null value is defined for bit arrays.

Character.

If the value of the TFORMn keyword specifies data type A, field n shall contain a character string of  zero or more members, composed of  ASCII text. This character string may be terminated before the length specified by the repeat count  by  an ASCII NULL (hexadecimal code 00). Characters after the first ASCII NULL are not defined. A string with the number of characters specified by the repeat count is not NULL terminated. Null strings are defined by the presence of an ASCII NULL as the first character.

Unsigned 8-Bit integer.

If  the value of the TFORMn keyword specifies data type B, the data in field n shall consist of unsigned 8-bit integers, with  the most significant bit first, and subsequent bits in order of decreasing significance. Null values are given by the value of the  associated TNULLn keyword.

16-Bit integer.

If the value of the TFORMn keyword specifies data type I, the data in field n shall consist of twos-complement signed 16-bit integers, contained  in two bytes. The most significant byte shall be first. Within each byte the most significant bit shall be first, and subsequent bits shall be in order of decreasing significance. Null values are given by the value of the  associated TNULLn keyword. Unsigned integers can be represented using the convention described in Sect. 6.2.4.

32-Bit integer.

If the value of the TFORMn keyword specifies data type J, the data in field n shall consist of twos-complement signed 32-bit integers, contained  in four bytes. The most significant byte shall be first, and subsequent bytes shall be in order of decreasing significance. Within each byte, the most significant bit shall be first, and subsequent bits shall be in order of decreasing significance. Null values are given by the value of the  associated TNULLn keyword. Unsigned integers can be represented using the convention described in Sect. 6.2.4.

Single precision floating point.

If  the value of the TFORMn keyword specifies data type E, the data in field n shall consist of  ANSI/IEEE-754 (IEEE 1985) 32-bit floating point  numbers, as described in Appendix .15. All IEEE special values  are recognized. The IEEE NaN is  used to represent invalid values.

Double precision floating point.

If the value of the TFORMn keyword specifies data type D, the data in field n shall consist of ANSI/IEEE-754 (IEEE 1985) 64-bit double precision floating point  numbers, as described in Appendix .15. All IEEE special values  are recognized. The IEEE NaN is  used to represent invalid values.

Single precision complex.

If  the value of the TFORMn keyword specifies data type C, the data in field n shall consist of a sequence of pairs of 32-bit  single precision floating point  numbers. The first member of each pair shall represent the real part of a complex number, and the second member shall represent the imaginary part of that complex number. If either member contains a NaN, the entire complex value is invalid.

Double precision complex.

If the value of the TFORMn keyword specifies data type M, the data in field n shall consist of a sequence of pairs of 64-bit double precision floating point numbers. The first member of each pair shall represent the real part of a complex number, and the second member of the pair shall represent the imaginary part of that complex number. If either member contains a NaN, the entire complex value is invalid.

Array descriptor.

If  the value of the TFORMn keyword specifies data type P, the data  in field n shall consist of not more than one pair of  32-bit integers. The meaning of these integers is not defined by this standard. The proposed application of this data type is described in Appendix .3.

8.3.3.2. Bytes following main table.

The main data table shall be followed by zero or more bytes, as specified by the value of the PCOUNT keyword. The meaning of these bytes is not further defined by this standard. One proposed application is described in Appendix .3.

   
8.3.4 Data display

Character data are encoded under format code Aw. If the character datum has length less than or equal to w, it is represented on output right-justified in a string of w characters. If the character datum has length greater than w, the first w characters of the datum are represented on output in a string of w characters. Character data are not surrounded by single or double quotation marks unless those marks are themselves part of the data value. Logical data are encoded under format code Lw. Logical data are represented on output with the character T for true or F for false right justified in a blank-filled string of w characters. A null value may be represented by a completely blank string of w characters.

Integer data (including bit X and byte B type fields) are encoded under format codes Iw.m, Bw.m, Ow.m, and Zw.m. The default value of m is one and the ".m'' is optional. The first letter of the code specifies the number base for the encoding with I for decimal (10), B for binary (2), O for octal (8), and Z for hexadecimal (16). Hexadecimal format uses the upper-case letters A through F to represent decimal values 10 through 15. The output field consists of w characters containing zero or more leading blanks followed by a minus if the internal datum is negative followed by the magnitude of the internal datum in the form of an unsigned integer constant in the specified number base with only as many leading zeros as are needed to have at least m numeric digits. Note that m $\leq$ w is allowed if all values are positive, but m < w is required if any values are negative. If the number of digits required to represent the integer datum exceeds w, then the output field consists of a string of w asterisk (*) characters.

Real data are encoded under format codes Fw.d, Ew.dEe, Dw.dEe, ENw.d, and ESw.d. In all cases, the output is a string of w characters including the decimal point, any sign characters, and any exponent including the exponent's indicators, signs, and values. If the number of digits required to represent the real datum exceeds w, then the output field consists of a string of w asterisk (*) characters. In all cases, d specifies the number of digits to appear to the right of the decimal point. The F format code output field consists of ${\tt w} - {\tt d} - 1$ characters containing zero or more leading blanks followed by a minus if the internal datum is negative followed by the absolute magnitude of the internal datum in the form of an unsigned integer constant. These characters are followed by a decimal point (".'') and d characters giving the fractional part of the internal datum, rounded by the normal rules of arithmetic to d fractional digits. For the E and D format codes, an exponent is taken such that the fraction $0.1 \le \vert{\rm datum}\vert / 10^{\rm exponent} < 1.0$. The fraction (with appropriate sign) is output with an F format of width $ {\tt w} - {\tt e} - 2$ characters with d characters after the decimal followed by an E or D followed by the exponent as a signed ${\tt e} + 1$ character integer with leading zeros as needed. The default value of e is 2 when the Ee portion of the format code is omitted. If the exponent value will not fit in ${\tt e} + 1$ characters but will fit in ${\tt e} + 2$ then the E (or D) is omitted and the wider field used. If the exponent value will not fit (with a sign character) in ${\tt e} + 2$ characters, then the entire w-character output field is filled with asterisks (*). The ES format code is processed in the same manner as the E format code except that the exponent is taken so that $ 1.0 \leq {\rm fraction} < 10$. The EN format code is processed in the same manner as the E format code except that the exponent is taken to be an integer multiple of 3 and so that $ 1.0\leq {\rm fraction} < 1000.0$. All real format codes have number base 10. There is no difference between E and D format codes on input other than an implication with the latter of greater precision in the internal datum. The Gw.dEe format code may be used with data of any type. For data of type integer, logical, or character, it is equivalent to Iw, Lw, or Aw, respectively. For data of type real, it is equivalent to an F format (with different numbers of characters after the decimal) when that format will accurately represent the value and is equivalent to an E format when the number (in absolute value) is either very small or very large. Specifically, for real values outside the range $0.1\,-\,0.5\times 10^{-{\tt d}-1} \leq {\rm value} < 10^{\tt d}\,-\,0.5$, it is equivalent to Ew.dEe. For real values within the above range, it is equivalent to F ${\tt w}^{\prime}.{\tt d}^{\prime}\,$ followed by $2 + {\tt e}$ blanks, where ${\tt w}^{\prime} = {\tt w} - {\tt e} - 2$ and ${\tt d}^{\prime} =
{\tt d} - k$ for $k = 0,1,\ldots,{\tt d}$ if the real datum value lies in the range $10^{k-1}
\left(1\,-\, 0.5\times10^{-{\tt d}}\right) \leq {\rm value} \le 10^k
\left(1\,-\, 0.5\times10^{-{\tt d}}\right)$.

Complex data are encoded with any of the real data formats as described above. The same format is used for the real and imaginary parts. It is recommended that the 2 values be separated by a comma and enclosed in parentheses with a total field width of $2{\tt w} + 3$.


next previous
Up: Definition of the Flexible (FITS)

Copyright ESO 2001