[fitsbits] TLONG pixels - cfitsio bug or misuse on my part?

William Pence William.Pence at nasa.gov
Mon Jun 17 13:33:30 EDT 2013


When calling fits_read_img in CFITSIO, the data type code should 
correspond to the C data type of the array that the image is being read 
into.  For C arrays of 'short', 'int', or 'long', you should specify the 
CFITSIO types of TSHORT, TINT, or TLONG, respectively. If you specify 
TLONG, then CFITSIO will return an array of 32-bit signed integers or 
64-bit signed integers, depending on the size of the C long datatype on 
that machine.

If you have more questions about CFITSIO, you can send them to me 
directly instead of on this list.

regards,
Bill

On 06/17/2013 12:10 PM, Gallagher James wrote:
> Hi,
>
> Is there a known issue with TLONG and 32-bit data with fits_read_img()? Or, when reading into an array of 32-bit integers should I be using TINT?
>
> I'm asking because I have some code (inherited) that reads from an HDU IMAGE, where the BITPIX is a LONG_IMG, into an array of 32-bit integers using fits_read_img() with a type of TLONG. The library behaves as if its writing into an array of 64-bit integers. I can get correct behavior using TINT in place of TLONG, but I wonder why TLONG is not working… This is happening with library versions 3270 and 3340 on both OSX and Linux.
>
> Thanks,
> James
> --
> James Gallagher
> jgallagher at opendap.org
> 406.723.8663
>

-- 
____________________________________________________________________
Dr. William Pence                       William.Pence at nasa.gov
NASA/GSFC Code 662       HEASARC        +1-301-286-4599 (voice)
Greenbelt MD 20771                      +1-301-286-1684 (fax)





More information about the fitsbits mailing list