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

Bob Garwood bgarwood at nrao.edu
Mon Jun 17 12:36:09 EDT 2013


TLONG is a signed long type and so it can vary depending on what a long is.

TINT32BIT is a signed 32-bit integer and that seems like what you want.

According to section 4.1 of the CFITSIO user's reference guide TINT32BIT 
corresponds to TFORM code "J".

Cheers,
Bob Garwood

On 06/17/2013 12:27 PM, Eric Greisen wrote:
> 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
>
> _______________________________________________
> fitsbits mailing list
> fitsbits at listmgr.cv.nrao.edu
> http://listmgr.cv.nrao.edu/mailman/listinfo/fitsbits






More information about the fitsbits mailing list