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

Eric Greisen egreisen at nrao.edu
Mon Jun 17 12:27:51 EDT 2013


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.

I am not a cfitsio user, but a long-time programmer anyway.
"long" used to be 32-bits on all the machine I encountered
and it is now 64 bits on at least some machines (those with 64-bit OS 
versions).  I bet you are hitting a time-dependency in the definition of 
the vague word "long".

Cheers

Eric Greisen




More information about the fitsbits mailing list