[fitsbits] Possible bug in CFITSIO

David C. Partridge david.partridge at perdrix.co.uk
Fri Feb 28 13:16:23 EST 2020


That's excellent - now I understand - I will read it all as double - it will massively simplify the quite arcane code.

ThanksDavid


-----Original Message-----
From: THIERRY FORVEILLE [mailto:thierry.forveille at univ-grenoble-alpes.fr] 
Sent: 28 February 2020 12:08
To: David C. Partridge
Cc: William Pence; CCFITS Help Desk; fitsbits at listmgr.nrao.edu
Subject: Re: [fitsbits] Possible bug in CFITSIO


> So for clarity:
> 
> 
> 
> Are you saying that if the headers of a 16 bit FITS file say:
> 
> 
> 
>    SIMPLE  =                    T / file does conform to FITS standard
> 
>    BITPIX  =                   16 / number of bits per data pixel
> 
>    BZERO   =                32768 / offset data range to that of unsigned short
> 
>    BSCALE  =                    1 / default scaling factor
> 
> 
> 
> that I should ignore the fact the BITPIX is telling me to use signed short, 
>
BITPIX is not telling you what to use in your code, just what's stored in the 
file. _That_ is signed shorts, but what you convert it to is totally up to you. 
I'd use floats (because I'll promptly do things like averaging multiple images,
and those of course step out of the integer space), but you are welcome to use 
unsigned shorts if you like, or signed longs, or even complex doubles for the 
matter.




More information about the fitsbits mailing list