7.3. BINARY TABLE EXTENSION
63
a Fortran CHARACTER*20 variable could be represented in a binary table as a character
array declared as TFORMn = '20A'. Arrays of strings, i.e., multi-dimensional character
arrays, may be represented using the TDIMn notation. For example, if TFORMn = '60A'
and TDIMn = '(5,4,3)', then the entry consists of a 4×3 array of strings of 5 characters
each.
7.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 in the supplemental data area. The positions
in the last data block after the last additional byte, or, if there are no additional bytes,
the last character of the last row of the main data table, shall be filled by setting all
bits to zero.
7.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. 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 data block immediately
following the last header block. Subsequent rows shall begin immediately following the
end of the previous row, with no intervening bytes, independent of the FITS block
structure. Words need not be aligned along word boundaries.
Each row in the array shall consist of a sequence of from 0 to 999 fields as specified
by the TFIELDS keyword. The number of elements in each field and their data type
shall be specified by the TFORMn keyword in the associated header. 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. Writers of binary tables should select a format
appropriate to the form, range of values, and accuracy of the data in the table. 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 00) indicates a null 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
FITS Standard