60
SECTION 7. STANDARD EXTENSIONS
Table 7.7.
Usage of TZEROn to represent non-default integer data types.
Native
Physical
TZEROn
TFORMn
Data Type
Data Type
(-27)
unsigned
signed byte
'B'
-128
(215)
signed
unsigned 16-bit
'I'
32768
(231)
signed
unsigned 32-bit
'J'
2147483648
(263)
signed
unsigned 64-bit
'K'
9223372036854775808
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.1 is used to compute a true physical value from the quantity in field n. For
fields of type P or Q, the values of TSCALn and TZEROn are to be applied to the values in
the data array in the heap area, not the values of the array descriptor (see §7.3.5).
In addition to its use in representing floating point values as scaled integers, the
TZEROn keyword is also used when storing unsigned integer values in the field. In this
special case the TSCALn keyword shall have the default value of 1.0 and the TZEROn
keyword shall have one of the integer values shown in Table 7.7
Since the binary table format does not support a native unsigned integer data type
(except for the unsigned 8-bit 'B' column type), the unsigned values are stored in the
field as native signed integers with the appropriate integer offset specified by the TZEROn
keyword value shown in the table. For the byte column type, the converse technique can
be used to store signed byte values as native unsigned values with the negative TZEROn
offset. In each case, the physical value is computed by adding the offset specified by the
TZEROn keyword to the native data type value that is stored in the table field.
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, J or K, or P or Q array
descriptor fields (§7.3.5) that point to B, I, J or K integer arrays. The keyword must
not be used if field n is of any other data type. The value of this keyword corresponds
to the table column values before applying any transformation indicated by the TSCALn
and TZEROn keywords.
If the TSCALn and TZEROn keywords do not have the default values of 1.0 and 0.0,
respectively, then the value of the TNULLn keyword must equal the actual value in the
FITS file that is used to represent an undefined element and not the corresponding
physical value (computed from Eq. 7.1). To cite a specific, common example, unsigned
16-bit integers are represented in a signed integer column (with TFORMn = 'I') by
FITS Standard