Subject: question on data padding

From: tdame at cfa.harvard.edu (Thomas Dame)
Date: Wed, 19 Jun 1996 14:52:03 GMT

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), but case (c) would
seem like a better alternative, since integer zero can represent
a perfectly reasonable intensity in the image.  Admittedly this
is a minor issue that should hardly ever matter, but I would
like to follow the FITS standard.

Many thanks,

Tom Dame
tdame at cfa.harvard.edu

---

From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger)
Date: 20 Jun 1996 16:34 EDT

In article <tdame.1185583563A at cfanews.harvard.edu>, tdame at cfa.harvard.edu (Thomas Dame) writes...
>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
>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

---

From: svoynick at netcom.com (Stan Voynick)
Date: Fri, 28 Jun 1996 00:01:33 GMT

While I have generally assumed that all remaining bytes in the file should
be zero, regardless of the data format (equivalent to your option (a)), I
wanted to point out that your option (b) is not a feasible interpretation
anyway, as I often use BSCALE/BZERO scalings for our 16-bit images in
which no integer value even comes close to mapping to "zero intensity"
after being scaled by BSCALE and BZERO. 

                                  - Stan Voynick -
                                <svoynick at netcom.com>

In article <tdame.1185583563A at cfanews.harvard.edu>,
Thomas Dame <tdame at cfa.harvard.edu> wrote:
>an integer multiple of 2880 bytes in length... [.. snip ..]
>