img
36
SECTION 4. HEADERS
Table 4.9.
Usage of BZERO to represent non-default integer data types.
BITPIX
Native
Physical
BZERO
Data Type
Data Type
(-27)
8
unsigned
signed byte
-128
(215 )
16
signed
unsigned 16-bit
32768
(231 )
32
signed
unsigned 32-bit
2147483648
(263 )
64
signed
unsigned 64-bit
9223372036854775808
Besides its use in representing floating point values as scaled integers (see the de-
scription of the BSCALE keyword), the BZERO keyword is also used when storing unsigned
integer values in the FITS array. In this special case the BSCALE keyword shall have the
default value of 1.0, and the BZERO keyword shall have one of the integer values shown
in Table 4.9.
Since the FITS format does not support a native unsigned integer data type (except
for the unsigned 8-bit byte data type), the unsigned values are stored in the FITS array
as native signed integers with the appropriate integer offset specified by the BZERO
keyword value shown in the table. For the byte data type, the converse technique can
be used to store signed byte values as native unsigned values with the negative BZERO
offset. In each case, the physical value is computed by adding the offset specified by the
BZERO keyword to the native data type value that is stored in the FITS file.1
BUNIT Keyword  The value field shall contain a character string describing the phys-
ical units in which the quantities in the array, after application of BSCALE and BZERO,
are expressed. These units must follow the prescriptions of §4.3.
BLANK Keyword  This keyword shall be used only in headers with positive values
of BITPIX (i.e., in arrays with integer data). Bytes 1 through 8 contain the string
' (ASCII spaces in bytes 6 through 8). The value field shall contain an
`BLANKuuu
integer that specifies the value that is used within the integer array to represent pixels
that have an undefined physical value.
If the BSCALE and BZERO keywords do not have the default values of 1.0 and 0.0,
respectively, then the value of the BLANK keyword must equal the actual value in the
1
A more computationally efficient method of adding or subtracting the BZERO values is to simply
flip the most significant bit of the binary value. For example using 8-bit integers, the decimal value 248,
minus the BZERO value of 128 equals 120. The binary representation of 248 is 11111000. Flipping the
most significant bit gives the binary value 01111000, which is equal to decimal 120.
FITS Standard