[fitsbits] Output array type when BZERO is an integer {External}

Mohammad Akhlaghi mohammad at akhlaghi.org
Thu Mar 28 08:51:46 EDT 2024


On 3/28/24 11:09 AM, Richard J. Mathar via fitsbits wrote:
> In the particular case of the Java language (unlike C or python) the
> number of bytes in the integer classes are of fixed

C has fixed-width integer types since C99 (see [1]). The main problem in 
FITS with C originates with CFITSIO which defines types in 
non-fixed-width 'long', 'int' or 'short' types (see [2] for example); I 
guess that this is due to historic reasons: CFITSIO is older than C99.

The work-around is a wrapper function. For example in the case of GNU 
Astronomy Utilities (Gnuastro; written in C; and I maintain) we also use 
C99's fixed-width types for our internal data structure. To communicate 
with CFITSIO, have functions like those in [3].

Cheers,
Mohammad




[1] https://en.cppreference.com/w/c/types/integer
[2] https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node22.html
[3] https://git.savannah.gnu.org/cgit/gnuastro.git/tree/lib/fits.c#n454



More information about the fitsbits mailing list