question on data padding

Barry M. Schlesinger bschlesinger at nssdca.gsfc.nasa.gov
Thu Jun 20 16:34:00 EDT 1996


In article <tdame.1185583563A at cfanews.harvard.edu>, tdame at cfa.harvard.edu (Thomas Dame) writes...
>According to the FITS standard, the data array must be 
>an integer multiple of 2880 bytes in length.  To achieve
>this, Wells et al. (1981) states that:
> 
>     "The remainder of the last data array record after 
>    the last pixel of the array will be padded with zeros."
> 
>When the data is stored as 16-bit integers (BITPIX=16), it
>is not clear to me whether the padding should be:
> 
>a) integer zero (all bits zero)
> 
>b) the integer representing zero intensity in the image 
>  (i.e., the integer I such that BZERO + I*BSCALE = 0).
> 
>c) the integer BLANK 
> 
> 
>I would guess Wells et al. mean case (a), 

In the NOST codification, which was reviewed by the community as part 
of the development process, this concept was expressed in the 
language, "the remainder of the record shall be filled with zero 
values with the same data representation as the values in the array,"
which is what is meant in case A.

>but case (c) would
>seem like a better alternative, since integer zero can represent
>a perfectly reasonable intensity in the image.  

The values of NAXIS provide the size of the image, making it possible 
to distinguish those parts of the record in the array from those that 
are not.  

There are two interpretations that can be given to the phrase above,
"the integer BLANK"
1) The ASCII BLANK, which is a *character*.
2) The value of the BLANK keyword.

In the first case, the result would be to have the fill in a different 
format from the rest of the array, which would complicate the 
construction of reading programs.  Following the same principle of 
consistency between fill and data, ASCII table data records, which
consist of characters, are filled with ASCII blanks, while the fill at
the end of binary tables has all bits set to zero. In the second, the
BLANK keyword is optional, and thus no value may exist; also, the
values of the blank keyword will also appear in the array. 

				Barry M. Schlesinger
				FITS Support Office
				NSSDC/ADF




More information about the fitsbits mailing list