[fitsbits] Endian state of multibyte Binary Data in FITS files

Arnold Rots arots at head-cfa.cfa.harvard.edu
Fri Apr 25 10:07:58 EDT 2003


See Bill Cotton's concise response for answer to you question.

However, just in case you might have missed it, note that FITS does
not support unsigned integers.  The two obvious ways of encoding
them in FITS files are:

- Write 16-bit unsigned as 32-bit signed by prefixing each number with
two zero bytes.  But that, of course is rather wasteful - though maybe
not after compression.

- Convert to 16-bit signed.  That requires: add a keyword BZERO=32768
and flip the most significant bit of each 16-bit unsigned number.

I know it's a nuisance ...

  - Arnold

Milton Aupperle wrote:
> 
> First time poster and  a FITS newbie.
> 
> I'm working on exporting FITS files from the API of a Astronomical CCD
> Camera for Mac OS X (PowerPC processors Big Endian).  The binary images
> are 16 bit Unsigned  grayscale with the proper flags to indicate it is
> unsigned and how to convert it to. I have it all implemented and all
> the Mac FITS viewers I've used are happy with the FITS file it creates.
> 
> However, I'm somewhat concerned about Endian ness of the Binary data.
> I've looked through the various FITS specifications that I could find
> on the Web or in PDF, but I have as yet not found a FITs tag that
> indicates what endian the data is in.
> 
> Can anyone suggest a URL where I can find out about how to indicate or
> determine what Endian multibyte data is in?
> 
> Thanks in Advance..
> 
> Milton Aupperle
> www.outcastsoft.com
> miltons (at) outcastsoft (dot) com
> _______________________________________________
> fitsbits mailing list
> fitsbits at listmgr.cv.nrao.edu
> http://listmgr.cv.nrao.edu/mailman/listinfo/fitsbits
> 
--------------------------------------------------------------------------
Arnold H. Rots                                Chandra X-ray Science Center
Smithsonian Astrophysical Observatory                tel:  +1 617 496 7701
60 Garden Street, MS 67                              fax:  +1 617 495 7356
Cambridge, MA 02138                             arots at head-cfa.harvard.edu
USA                                     http://hea-www.harvard.edu/~arots/
--------------------------------------------------------------------------




More information about the fitsbits mailing list