The FITS format is the most common format to store data (images and tables) in astronomy. The CFITSIO library already provides a very good low-level collection of functions for manipulating FITS data. The low-level nature of CFITSIO is defined for versatility and portability. As a result, even a simple and basic operation, like reading an image or table column into memory, will require a special sequence of CFITSIO function calls which can be inconvenient and buggy to manage in separate locations. To ease this process, Gnuastro’s library provides wrappers for CFITSIO functions. With these, it much easier to read, write, or modify FITS file data, header keywords and extensions. Hence, if you feel these functions don’t exactly do what you want, we strongly recommend reading the CFITSIO manual to use its great features directly (afterwards, send us your wrappers so we can include it here for others to benefit also).
All the functions and macros introduced in this section are declared in gnuastro/fits.h. When you include this header, you are also including CFITSIO’s fitsio.h header. So you don’t need to explicitly include fitsio.h anymore and can freely use any of its macros or functions in your code along with those discussed here.
|• FITS macros errors filenames:||General macros, errors and checking names.|
|• CFITSIO and Gnuastro types:||Conversion between FITS and Gnuastro types.|
|• FITS HDUs:||Opening and getting information about HDUs.|
|• FITS header keywords:||Reading and writing FITS header keywords.|
|• FITS arrays:||Reading and writing FITS images/arrays.|
|• FITS tables:||Reading and writing FITS tables.|