Gnuastro library’s programming constructs (function declarations, macros, data structures, or global variables) are classified by context into multiple header files (see Headers)128. 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 example). Gnuastro 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. The outside libraries that need to be linked for such functions are mentioned following the function name. See BuildProgram for a small Gnuastro program that will take care of the libraries to link against and lets you focus on your exciting science.
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.|
|• 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.|
|• FITS files:||Working with FITS data.|
|• World Coordinate System:||Dealing with the world coordinate system.|
|• Text files:||Functions to work on Text files.|
|• Table input output:||Reading and writing table columns.|
|• 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.|
|• Statistical operations:||Functions for basic statistics.|
|• Binary datasets:||Datasets that can only have values of 0 or 1.|
|• Convolution functions:||Library functions to do convolution.|
|• Interpolation:||Interpolate (over blank values possibly).|
|• Git wrappers:||Wrappers for functions in libgit2.|
Within Gnuastro’s source, all installed .h files in lib/gnuastro/ are accompanied by a .c file in /lib/.