Gnuastro library’s programming constructs (function declarations, macros, data structures, or global variables) are classified by context into multiple header files (see Headers)173. In this section, the functions in each header will be discussed under a separate sub-section, which includes the name of the header. Assuming a function declaration is in headername.h, you can include its declaration in your source code with:
# include <gnuastro/headername.h>
The names of all constructs in headername.h are prefixed with
GAL_HEADERNAME_ for macros). The
gal_ prefix stands for GNU Astronomy Library.
Gnuastro library functions are compiled into a single file which can be linked on the command-line with the -lgnuastro option. See Linking and Summary and example on libraries for an introduction on linking and some fully working examples of the libraries.
Gnuastro’s library is a high-level library which depends on lower level libraries for some operations (see Dependencies). Therefore if at least one of Gnuastro’s functions in your program use functions from the dependencies, you will also need to link those dependencies after linking with Gnuastro. See BuildProgram for a convenient way to deal with the dependencies. BuildProgram will take care of the libraries to link with your program (which uses the Gnuastro library), and can even run the built program afterwards. Therefore it allows you to conveniently focus on your exciting science/research when using Gnuastro’s libraries.
Libraries are still under heavy development: Gnuastro was initially created to be a collection of command-line programs. However, as the programs and their the shared functions grew, internal (not installed) libraries were added. Since the 0.2 release, the libraries are install-able. Hence the libraries are currently under heavy development and will significantly evolve between releases and will become more mature and stable in due time. It will stabilize with the removal of this notice. Check the NEWS file for interface changes. If you use the Info version of this manual (see Info), you don’t have to worry: the documentation will correspond to your installed version.
|• Configuration information:||General information about library config.|
|• Multithreaded programming:||Tools for easy multi-threaded operations.|
|• Library data types:||Definitions and functions for types.|
|• Pointers:||Wrappers for easy working with pointers.|
|• Library blank values:||Blank values and functions to deal with them.|
|• Library data container:||General data container in Gnuastro.|
|• Dimensions:||Dealing with coordinates and dimensions.|
|• Linked lists:||Various types of linked lists.|
|• Array input output:||Reading and writing images or cubes.|
|• Table input output:||Reading and writing table columns.|
|• FITS files:||Working with FITS data.|
|• File input output:||Reading and writing to various file formats.|
|• World Coordinate System:||Dealing with the world coordinate system.|
|• Arithmetic on datasets:||Arithmetic operations on a dataset.|
|• Tessellation library:||Functions for working on tiles.|
|• Bounding box:||Finding the bounding box.|
|• Polygons:||Working with the vertices of a polygon.|
|• Qsort functions:||Helper functions for Qsort.|
|• Permutations:||Re-order (or permute) the values in a dataset.|
|• Matching:||Matching catalogs based on position.|
|• Statistical operations:||Functions for basic statistics.|
|• Binary datasets:||Datasets that can only have values of 0 or 1.|
|• Labeled datasets:||Working with Segmented/labeled datasets.|
|• Convolution functions:||Library functions to do convolution.|
|• Interpolation:||Interpolate (over blank values possibly).|
|• Git wrappers:||Wrappers for functions in libgit2.|
|• Cosmology library:||Cosmological calculations.|
Within Gnuastro’s source, all installed .h files in lib/gnuastro/ are accompanied by a .c file in /lib/.