Subject: 16-bit FITS integers (was Re: st6 images wanted)

From: sla at umbra.UCSC.EDU (Steve Allen)
Date: 25 Nov 1992 07:26:20 GMT

In article <24NOV199221252383 at stars.gsfc.nasa.gov>
thompson at stars.gsfc.nasa.gov (William Thompson, code 682.1, x2040) writes:
>However, as Barry pointed out, there are ways to write the data out to FITS
>files, and still be legal.  You could,
>       2.  Subtract 32767 from the data, and set BZERO = -32767.
>However, if you don't solve it in a "legal" way, then you *have* to set SIMPLE
>to F, because it *isn't* a FITS file.

It might be better to subtract 32768 from the data and set BZERO=-32768
The advantage of this is that no subtraction is actually required, you
need merely bit flip the most significant bit (or XOR with -32768, as
you prefer to visualize it).  This is likely to be *much* quicker than
subtraction depending on the hardware that is doing the arithmetic.

This solution is likely to be the one implemented in the DSP units that
will be reading out the CCDs on the Keck telescope.  The bit flip merely
introduces one clock cycle of delay in the data pipeline, which is
unnoticeable when reading out several million pixels.
_______________________________________________________________________________
Steve Allen          | That was the equation!         |   sla at lick.ucsc.edu
UCO/Lick Observatory | Existence!...Survival must     | If the UC were opining,
Santa Cruz, CA 95064 | cancel out programming! -- Ruk | it wouldn't tell me.