gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 4fedb9d 038/113: Merged with master, conflicts


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 4fedb9d 038/113: Merged with master, conflicts fixed
Date: Fri, 16 Apr 2021 10:33:39 -0400 (EDT)

branch: master
commit 4fedb9de307004ebeb2983d0a1384efc69a7f847
Merge: fb3660f 4f1a586
Author: Mohammad Akhlaghi <akhlaghi@gnu.org>
Commit: Mohammad Akhlaghi <akhlaghi@gnu.org>

    Merged with master, conflicts fixed
    
    All the recent work in master is now available in this branch also. In
    particular, the NEWS file was just replaced with the master branch's NEWS
    file, since this branch is not yet released. Later, when it gets released
    (within the MUSE collaboration at first), a special topic will be made
    there to add updated features. Finally, when this branch gets publicly
    released, it can be added to the master's NEWS file.
---
 NEWS                            |  43 +++++----
 bin/TEMPLATE/ui.h               |   3 +
 bin/arithmetic/ui.h             |   6 ++
 bin/buildprog/ui.h              |   3 +
 bin/convertt/args.h             |  18 ++--
 bin/convertt/ui.c               |  10 --
 bin/convertt/ui.h               |  13 +++
 bin/convolve/ui.c               |   9 --
 bin/convolve/ui.h               |  13 +++
 bin/cosmiccal/args.h            | 176 ++++++++++++++++++++++++++++++----
 bin/cosmiccal/astcosmiccal.conf |   1 -
 bin/cosmiccal/cosmiccal.c       | 205 +++++++++++++++++++++++++++++++--------
 bin/cosmiccal/main.h            |   8 +-
 bin/cosmiccal/ui.c              |  95 +++++++++++++++++-
 bin/cosmiccal/ui.h              |  43 +++++++--
 bin/crop/args.h                 |  26 ++---
 bin/crop/ui.c                   |  15 +--
 bin/crop/ui.h                   |  16 ++++
 bin/fits/args.h                 |  28 +++---
 bin/fits/ui.c                   |   8 --
 bin/fits/ui.h                   |  14 +++
 bin/mkcatalog/args.h            | 126 ++++++++++++------------
 bin/mkcatalog/ui.c              |   8 +-
 bin/mkcatalog/ui.h              |  14 +++
 bin/mknoise/ui.h                |   3 +
 bin/mkprof/args.h               |  66 ++++++-------
 bin/mkprof/ui.c                 |  11 ---
 bin/mkprof/ui.h                 |  15 +++
 bin/noisechisel/args.h          |  64 ++++++-------
 bin/noisechisel/ui.c            |   6 --
 bin/noisechisel/ui.h            |  14 +++
 bin/statistics/args.h           |  76 +++++++--------
 bin/statistics/ui.c             |  15 +--
 bin/statistics/ui.h             |  16 ++++
 bin/table/ui.h                  |   3 +
 bin/warp/args.h                 |  20 ++--
 bin/warp/ui.c                   |   9 --
 bin/warp/ui.h                   |  13 +++
 doc/gnuastro.texi               | 208 +++++++++++++++++++++++++++++++---------
 39 files changed, 1005 insertions(+), 435 deletions(-)

diff --git a/NEWS b/NEWS
index af7058f..eb0a522 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,14 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   BuildProgram: The new `--la' option allows the identification of a
   different Libtool `.la' file for Libtool linking information.
 
+  CosmicCalculator: all the various cosmological calculations can now be
+  requested individually in one line with a specific option added for each
+  calculation (for example `--age' or `--luminositydist' for the age of the
+  universe at a given redshift or the luminosity distance). Therefore the
+  old `--onlyvolume' and `--onlyabsmagconv' options are now removed. To
+  effectively use these new features, please review the "Invoking
+  CosmicCalculator" section of the book.
+
   Fits: when an extension/HDU is identified on the command-line with the
   `--hdu' option and no operation is requested, the full list of header
   keywords in that HDU will be printed (as if only `--printallkeys' was
@@ -74,6 +82,9 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
 ** Changed features
 
+  CosmicCalculator: The redshift is no longer mandatory. When no redshift
+  is given, it will only print the input parameters (cosmology) and abort.
+
   `gal_binary_fill_holes' now accepts a `connectivity' and `maxsize'
   argument to specify the connectivity of the holes and the maximum size of
   acceptable holes to fill.
@@ -91,6 +102,13 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   `gal_wcs_pixel_area_arcsec2' will return NaN (instead of aborting) when
   input is unreasonable (not two dimensions or not in units of degrees).
 
+  `gal_wcs_world_to_img' and `gal_wcs_img_to_world': Until now, these two
+  WCS conversion functions would explicitly assume RA and Dec and work
+  based on input arrays (so for example it was also necessary to give the
+  number of elements and etc). They now accept `gal_data_t' as input for
+  the input coordinates, thus their API has been greatly simplified and
+  their functionality increased.
+
 ** Bug fixes
 
   ConvertType crash when changing values (bug #52010).
@@ -102,6 +120,8 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
   CFITSIO 3.42 and libcurl crash at Gnuastro configure time (bug #52152).
 
+  MakeCatalog crash in upper-limit with full size label (bug #52281).
+
 
 
 * Noteworthy changes in release 0.4 (library 2.0.0) (2017-09-13) [stable]
@@ -122,26 +142,13 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   is called, the `--background', `--zeropoint' and other option values will
   be ignored.
 
-  MakeProfiles: can build 3D ellipsoids of any orientation and shape. The
-  following options are new to MakeProfiles for enabling 3D profiles:
-  `--p2col', `--p3col' (second two Euler angles), and `--q2col' (axis ratio
-  of third axis to major axis). To help in using the 3D features, a
-  `astmkprof-3d.conf' configuration file will also be installed with
-  Gnuastro. The `--config' option can be used to specify default values for
-  3D profiles.
+  MakeProfiles: the new `--kernel' option can make a kernel image without
+  the need to define a catalog. With this option, a catalog (or
+  accompanying background image) must not be given.
 
   MakeProfiles: the new `--pc', `--cunit' and `--ctype' options can be used
-  along with `--crpix', `--crval' and `--cdelt' to fully specify the world
-  coordinate system (WCS) keywords of the output FITS file.
-
-  MakeProfiles: can build a new raidal profile called `distance' (code
-  7). The value this profile gives to each pixel is equal to its distance
-  from the center. It can be used to build any other radial profile that is
-  not supported by MakeProfiles.
-
-  MakeProfiles: with the new `--mcolisbrightness' ("mcol-is-brightness")
-  option, the `--mcol' values of the catalog will be interpretted as total
-  brightness (sum of pixel values), not magnitude.
+  to specify the PC matrix, CUNIT and CTYPE world coordinate system
+  keywords of the output FITS file.
 
   MakeProfiles: the new `distance' profile will save the radial distance of
   each pixel. This may be used to define your own profiles that are not
diff --git a/bin/TEMPLATE/ui.h b/bin/TEMPLATE/ui.h
index ec2a41b..290caa1 100644
--- a/bin/TEMPLATE/ui.h
+++ b/bin/TEMPLATE/ui.h
@@ -23,6 +23,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
 
 
 
diff --git a/bin/arithmetic/ui.h b/bin/arithmetic/ui.h
index 63ecc17..5fcffce 100644
--- a/bin/arithmetic/ui.h
+++ b/bin/arithmetic/ui.h
@@ -23,6 +23,12 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
 
 /* Available letters for short options:
 
diff --git a/bin/buildprog/ui.h b/bin/buildprog/ui.h
index 40c72ad..712147b 100644
--- a/bin/buildprog/ui.h
+++ b/bin/buildprog/ui.h
@@ -23,6 +23,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
 
 
 
diff --git a/bin/convertt/args.h b/bin/convertt/args.h
index 9bbcec4..950ceea 100644
--- a/bin/convertt/args.h
+++ b/bin/convertt/args.h
@@ -91,7 +91,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Flux:",
-      ARGS_GROUP_FLUX
+      UI_GROUP_FLUX
     },
     {
       "fluxlow",
@@ -99,7 +99,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Lower flux truncation value.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->fluxlowstr,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -112,7 +112,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Higher flux truncation value.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->fluxhighstr,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -125,7 +125,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Maximum byte value for all color channels.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->maxbyte,
       GAL_TYPE_UINT8,
       GAL_OPTIONS_RANGE_GE_0,
@@ -138,7 +138,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Set value of fluxlow as the minimum byte value.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->flminbyte,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -151,7 +151,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Set value of fluxhigh as the maximum byte value.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->fhmaxbyte,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -164,7 +164,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Change pixel values `from_1:to_1,from_2:to_2`.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->changestr,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -177,7 +177,7 @@ struct argp_option program_options[] =
       0,
       0,
       "First truncate then change pixel values.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->changeaftertrunc,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -190,7 +190,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Invert the values in JPEG and EPS/PDF.",
-      ARGS_GROUP_FLUX,
+      UI_GROUP_FLUX,
       &p->invert,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
diff --git a/bin/convertt/ui.c b/bin/convertt/ui.c
index e52d85b..65d01f6 100644
--- a/bin/convertt/ui.c
+++ b/bin/convertt/ui.c
@@ -80,16 +80,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will convert 
any of the "
 
 
 
-/* Option groups particular to this program */
-enum program_args_groups
-{
-  ARGS_GROUP_FLUX = GAL_OPTIONS_GROUP_AFTER_COMMON,
-};
-
-
-
-
-
 
 
 
diff --git a/bin/convertt/ui.h b/bin/convertt/ui.h
index bd60bae..2afe039 100644
--- a/bin/convertt/ui.h
+++ b/bin/convertt/ui.h
@@ -23,6 +23,19 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program */
+enum program_args_groups
+{
+  UI_GROUP_FLUX = GAL_OPTIONS_GROUP_AFTER_COMMON,
+};
+
 
 
 
diff --git a/bin/convolve/ui.c b/bin/convolve/ui.c
index fb80e8f..d2f892e 100644
--- a/bin/convolve/ui.c
+++ b/bin/convolve/ui.c
@@ -79,15 +79,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will 
convolve an input "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_MESH_GRID = GAL_OPTIONS_GROUP_AFTER_COMMON,
-};
-
-
-
-
 
 
 
diff --git a/bin/convolve/ui.h b/bin/convolve/ui.h
index fc02db3..9cff5a0 100644
--- a/bin/convolve/ui.h
+++ b/bin/convolve/ui.h
@@ -23,6 +23,19 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_MESH_GRID = GAL_OPTIONS_GROUP_AFTER_COMMON,
+};
+
 
 
 
diff --git a/bin/cosmiccal/args.h b/bin/cosmiccal/args.h
index f6acd38..46d4bfd 100644
--- a/bin/cosmiccal/args.h
+++ b/bin/cosmiccal/args.h
@@ -41,7 +41,7 @@ struct argp_option program_options[] =
       &p->redshift,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_GE_0,
-      GAL_OPTIONS_MANDATORY,
+      GAL_OPTIONS_NOT_MANDATORY,
       GAL_OPTIONS_NOT_SET
     },
     {
@@ -101,34 +101,178 @@ struct argp_option program_options[] =
 
 
     {
-      "onlyvolume",
-      UI_KEY_ONLYVOLUME,
+      0, 0, 0, 0,
+      "Single row calculations",
+      UI_GROUP_SPECIFIC
+    },
+    {
+      "agenow",
+      UI_KEY_AGENOW,
       0,
       0,
-      "Only print comoving volume in Mpc^3.",
-      GAL_OPTIONS_GROUP_OUTPUT,
-      &p->onlyvolume,
+      "Age of universe now (Gyr).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
       GAL_OPTIONS_NOT_MANDATORY,
-      GAL_OPTIONS_NOT_SET
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
     },
     {
-      "onlyabsmagconv",
-      UI_KEY_ONLYABSMAGCONV,
+      "criticaldensitynow",
+      UI_KEY_CRITICALDENSITYNOW,
       0,
       0,
-      "Only print conversion to absolute magnitude.",
-      GAL_OPTIONS_GROUP_OUTPUT,
-      &p->onlyabsmagconv,
+      "Critical density now (g/cm^3).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
       GAL_OPTIONS_NOT_MANDATORY,
-      GAL_OPTIONS_NOT_SET
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "properdistance",
+      UI_KEY_PROPERDISTANCE,
+      0,
+      0,
+      "Proper distance to z (Mpc).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "angulardimdist",
+      UI_KEY_ANGULARDIMDIST,
+      0,
+      0,
+      "Angular diameter distance (Mpc).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "arcsectandist",
+      UI_KEY_ARCSECTANDIST,
+      0,
+      0,
+      "Tangential dist. covered by 1arcsec at z (kpc).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "luminositydist",
+      UI_KEY_LUMINOSITYDIST,
+      0,
+      0,
+      "Luminosity distance to z (Mpc).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "distancemodulus",
+      UI_KEY_DISTANCEMODULUS,
+      0,
+      0,
+      "Distance modulus at z (no units).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "absmagconv",
+      UI_KEY_ABSMAGCONV,
+      0,
+      0,
+      "Conversion to absolute magnitude (no unit).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "age",
+      UI_KEY_AGE,
+      0,
+      0,
+      "Age of universe at z (Gyr).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "lookbacktime",
+      UI_KEY_LOOKBACKTIME,
+      0,
+      0,
+      "Look back time to z (Gyr).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "criticaldensity",
+      UI_KEY_CRITICALDENSITY,
+      0,
+      0,
+      "Critical density at z (g/cm^3).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
+    },
+    {
+      "volume",
+      UI_KEY_VOLUME,
+      0,
+      0,
+      "Comoving volume (4pi str) to z (Mpc^3).",
+      UI_GROUP_SPECIFIC,
+      &p->specific,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_add_to_single_value,
     },
-
-
-
 
 
     {0}
diff --git a/bin/cosmiccal/astcosmiccal.conf b/bin/cosmiccal/astcosmiccal.conf
index 485a128..bac2d94 100644
--- a/bin/cosmiccal/astcosmiccal.conf
+++ b/bin/cosmiccal/astcosmiccal.conf
@@ -31,7 +31,6 @@
 # change this comment and cite the source.
 
 # Input:
- redshift            1
  H0              67.74
  olambda        0.6911
  omatter        0.3089
diff --git a/bin/cosmiccal/cosmiccal.c b/bin/cosmiccal/cosmiccal.c
index e1755fa..1350239 100644
--- a/bin/cosmiccal/cosmiccal.c
+++ b/bin/cosmiccal/cosmiccal.c
@@ -24,12 +24,15 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include <math.h>
 #include <stdio.h>
+#include <errno.h>
+#include <error.h>
 #include <stdlib.h>
 
 #include <gnuastro/cosmology.h>
 
 #include "main.h"
 
+#include "ui.h"
 #include "cosmiccal.h"
 
 
@@ -45,30 +48,33 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /**************************************************************/
 /************            Main function            *************/
 /**************************************************************/
-void
-cosmiccal(struct cosmiccalparams *p)
+static void
+cosmiccal_print_input(struct cosmiccalparams *p)
+{
+  printf("%s\n", PROGRAM_STRING);
+  printf("\n Input parameters\n");
+  printf(  " ----------------\n");
+  if( !isnan(p->redshift) )
+    printf(FLTFORMAT, "Desired redshift for calculations (z):", p->redshift);
+  printf(FLTFORMAT, "Expansion rate (Hubble constant, H0), now:", p->H0);
+  printf(FLTFORMAT, "Cosmological constant fractional density, now:",
+         p->olambda);
+  printf(FLTFORMAT, "Matter fractional density, now:", p->omatter);
+  printf(EXPFORMAT, "Radiation fractional density, now:", p->oradiation);
+  printf(EXPFORMAT, "Curvatue fractional density (from the above):",
+         1 - ( p->olambda + p->omatter + p->oradiation ));
+}
+
+
+
+
+
+static void
+cosmiccal_printall(struct cosmiccalparams *p)
 {
   double ad, ld, vz, pd, absmagconv;
   double curage, ccritd, distmod, outage, zcritd;
 
-  /* In case the user just wants one number, only print that and
-     return. */
-  if(p->onlyvolume){
-    printf("%f\n", gal_cosmology_comoving_volume(p->redshift, p->H0,
-                                                 p->olambda, p->omatter,
-                                                 p->oradiation));
-    return;
-  }
-  if(p->onlyabsmagconv){
-    pd=gal_cosmology_proper_distance(p->redshift, p->H0, p->olambda,
-                                     p->omatter, p->oradiation);
-    ld=pd*(1+p->redshift);
-    distmod=5*(log10(ld*1000000)-1);
-    absmagconv=distmod-2.5*log10(1+p->redshift);
-    printf("%f\n", absmagconv);
-    return;
-  }
-
   /* The user wants everything, do all the calculations and print
      everything with full descriptions. */
   curage=gal_cosmology_age(0.0f, p->H0, p->olambda, p->omatter,
@@ -77,20 +83,11 @@ cosmiccal(struct cosmiccalparams *p)
   ccritd=gal_cosmology_critical_density(0.0f, p->H0, p->olambda, p->omatter,
                                         p->oradiation);
 
-  vz=gal_cosmology_comoving_volume(p->redshift, p->H0, p->olambda, p->omatter,
-                                   p->oradiation);
-
   pd=gal_cosmology_proper_distance(p->redshift, p->H0, p->olambda, p->omatter,
                                    p->oradiation);
 
-  outage=gal_cosmology_age(p->redshift, p->H0, p->olambda, p->omatter,
-                           p->oradiation);
-
-  zcritd=gal_cosmology_critical_density(p->redshift, p->H0, p->olambda,
-                                        p->omatter, p->oradiation);
-
-  ad=gal_cosmology_angular_distance(p->redshift, p->H0, p->olambda, p->omatter,
-                                    p->oradiation);
+  ad=gal_cosmology_angular_distance(p->redshift, p->H0, p->olambda,
+                                    p->omatter, p->oradiation);
 
   ld=gal_cosmology_luminosity_distance(p->redshift, p->H0, p->olambda,
                                        p->omatter, p->oradiation);
@@ -101,18 +98,17 @@ cosmiccal(struct cosmiccalparams *p)
   absmagconv=gal_cosmology_to_absolute_mag(p->redshift, p->H0, p->olambda,
                                            p->omatter, p->oradiation);
 
+  outage=gal_cosmology_age(p->redshift, p->H0, p->olambda, p->omatter,
+                           p->oradiation);
+
+  zcritd=gal_cosmology_critical_density(p->redshift, p->H0, p->olambda,
+                                        p->omatter, p->oradiation);
+
+  vz=gal_cosmology_comoving_volume(p->redshift, p->H0, p->olambda, p->omatter,
+                                   p->oradiation);
+
   /* Print out results: */
-  printf("%s\n", PROGRAM_STRING);
-  printf("\n Input parameters\n");
-  printf(  " ----------------\n");
-  printf(FLTFORMAT, "Desired redshift for calculations (z):", p->redshift);
-  printf(FLTFORMAT, "Expansion rate (Hubble constant, H0), now:", p->H0);
-  printf(FLTFORMAT, "Cosmological constant fractional density, now:",
-         p->olambda);
-  printf(FLTFORMAT, "Matter fractional density, now:", p->omatter);
-  printf(EXPFORMAT, "Radiation fractional density, now:", p->oradiation);
-  printf(EXPFORMAT, "Curvatue fractional density (from the above):",
-         1 - ( p->olambda + p->omatter + p->oradiation ));
+  cosmiccal_print_input(p);
 
 
   printf("\n\n Universe now\n");
@@ -139,3 +135,128 @@ cosmiccal(struct cosmiccalparams *p)
   printf(    " ------------------------------------\n");
   printf(FLTFORMAT, "Comoving volume over 4pi stradian to z (Mpc^3):", vz);
 }
+
+
+
+
+
+void
+cosmiccal(struct cosmiccalparams *p)
+{
+  gal_list_i32_t *tmp;
+  double curage, zage;
+
+  /* If no redshift is given, just print the input parameters along with a
+     notice that further calculations are only possible with a redshift and
+     abort. */
+  if(isnan(p->redshift))
+    {
+      cosmiccal_print_input(p);
+      printf("\n\nPlease specify a redshift with the `--redshift' (or `-z') "
+             "option.\n");
+      return;
+    }
+
+  /* In case the user just wants one number, only print that and
+     return. */
+  if(p->specific)
+    {
+      for(tmp=p->specific;tmp!=NULL;tmp=tmp->next)
+        switch(tmp->v)
+          {
+          case UI_KEY_AGENOW:
+            printf("%f ", gal_cosmology_age(0.0f, p->H0, p->olambda,
+                                            p->omatter, p->oradiation));
+            break;
+
+          case UI_KEY_CRITICALDENSITYNOW:
+            printf("%e ", gal_cosmology_critical_density(0.0f, p->H0,
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
+            break;
+
+          case UI_KEY_PROPERDISTANCE:
+            printf("%f ", gal_cosmology_proper_distance(p->redshift, p->H0,
+                                                        p->olambda,
+                                                        p->omatter,
+                                                        p->oradiation));
+            break;
+
+          case UI_KEY_ANGULARDIMDIST:
+            printf("%f ", gal_cosmology_angular_distance(p->redshift, p->H0,
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
+            break;
+
+          case UI_KEY_ARCSECTANDIST:
+            printf("%f ", ( gal_cosmology_angular_distance(p->redshift, p->H0,
+                                                           p->olambda,
+                                                           p->omatter,
+                                                           p->oradiation)
+                            * 1000 * M_PI / 3600 / 180 ) );
+            break;
+
+          case UI_KEY_LUMINOSITYDIST:
+            printf("%f ", gal_cosmology_luminosity_distance(p->redshift,
+                                                            p->H0,
+                                                            p->olambda,
+                                                            p->omatter,
+                                                            p->oradiation));
+            break;
+
+          case UI_KEY_DISTANCEMODULUS:
+            printf("%f ", gal_cosmology_distance_modulus(p->redshift, p->H0,
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
+            break;
+
+          case UI_KEY_ABSMAGCONV:
+            printf("%f ", gal_cosmology_to_absolute_mag(p->redshift, p->H0,
+                                                        p->olambda,
+                                                        p->omatter,
+                                                        p->oradiation));
+            break;
+
+          case UI_KEY_AGE:
+            printf("%f ", gal_cosmology_age(p->redshift, p->H0, p->olambda,
+                                            p->omatter, p->oradiation));
+            break;
+
+          case UI_KEY_LOOKBACKTIME:
+            curage=gal_cosmology_age(0.0f, p->H0, p->olambda, p->omatter,
+                                     p->oradiation);
+            zage=gal_cosmology_age(p->redshift, p->H0, p->olambda, p->omatter,
+                                   p->oradiation);
+            printf("%f ", curage-zage);
+            break;
+
+          case UI_KEY_CRITICALDENSITY:
+            printf("%e ", gal_cosmology_critical_density(p->redshift, p->H0,
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
+            break;
+
+          case UI_KEY_VOLUME:
+            printf("%f ", gal_cosmology_comoving_volume(p->redshift, p->H0,
+                                                        p->olambda,
+                                                        p->omatter,
+                                                        p->oradiation));
+            break;
+
+          default:
+            error(EXIT_FAILURE, 0, "%s: a bug! Please contact us at %s to "
+                  "fix the problem. The code %d is not recognized as a "
+                  "single value calculation code", __func__,
+                  PACKAGE_BUGREPORT, tmp->v);
+          }
+
+      /* Print a new-line character to finish the output. */
+      printf("\n");
+    }
+  else
+    cosmiccal_printall(p);
+}
diff --git a/bin/cosmiccal/main.h b/bin/cosmiccal/main.h
index b8a04c7..df918c8 100644
--- a/bin/cosmiccal/main.h
+++ b/bin/cosmiccal/main.h
@@ -25,7 +25,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 /* Include necessary headers */
 #include <gnuastro/data.h>
-
+#include <gnuastro/list.h>
 #include <gnuastro-internal/options.h>
 
 /* Progarm names.  */
@@ -51,11 +51,9 @@ struct cosmiccalparams
   double               olambda; /* Current cosmological constant dens.  */
   double               omatter; /* Current matter density.              */
   double            oradiation; /* Current radiation density.           */
-  double            solidangle; /* Solid angle for volume (in stradian).*/
 
-  /* Output: */
-  uint8_t           onlyvolume; /* Only print the volume in Mpc^3.      */
-  uint8_t       onlyabsmagconv; /* Only print conversion to abs. mag.   */
+  /* Outputs. */
+  gal_list_i32_t     *specific; /* Codes for single row calculations.   */
 
   /* Internal: */
   time_t               rawtime; /* Starting time of the program.        */
diff --git a/bin/cosmiccal/ui.c b/bin/cosmiccal/ui.c
index 0e697a6..00ba91e 100644
--- a/bin/cosmiccal/ui.c
+++ b/bin/cosmiccal/ui.c
@@ -63,7 +63,10 @@ args_doc[] = "";
 
 const char
 doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will do cosmological "
-  "calculations.\n"
+  "calculations. If no redshfit is specified, it will only print the main "
+  "input parameters. If only a redshift is given, it will print a table of "
+  "all calculations. If any of the single row calculations are requested, "
+  "only their values will be printed with a single space between each.\n"
   GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
@@ -107,17 +110,33 @@ ui_initialize_options(struct cosmiccalparams *p,
   cp->program_authors    = PROGRAM_AUTHORS;
   cp->coptions           = gal_commonopts_options;
 
+  /* Program specific initializations. */
+  p->redshift            = NAN;
+
   /* Modify the common options. */
   for(i=0; !gal_options_is_last(&cp->coptions[i]); ++i)
     {
       /* Select by group. */
       switch(cp->coptions[i].group)
         {
+        case GAL_OPTIONS_GROUP_OUTPUT:
         case GAL_OPTIONS_GROUP_TESSELLATION:
           cp->coptions[i].doc=NULL; /* Necessary to remove title. */
           cp->coptions[i].flags=OPTION_HIDDEN;
           break;
         }
+
+      /* Select specific options. */
+      switch(cp->coptions[i].key)
+        {
+        case GAL_OPTIONS_KEY_HDU:
+        case GAL_OPTIONS_KEY_TYPE:
+        case GAL_OPTIONS_KEY_SEARCHIN:
+        case GAL_OPTIONS_KEY_IGNORECASE:
+        case GAL_OPTIONS_KEY_TABLEFORMAT:
+          cp->coptions[i].flags=OPTION_HIDDEN;
+          break;
+        }
     }
 }
 
@@ -169,6 +188,45 @@ parse_opt(int key, char *arg, struct argp_state *state)
 
 
 
+static void *
+ui_add_to_single_value(struct argp_option *option, char *arg,
+                      char *filename, size_t lineno, void *params)
+{
+  /* In case of printing the option values. */
+  if(lineno==-1)
+    error(EXIT_FAILURE, 0, "currently the options to be printed in one row "
+          "(like `--age', `--luminositydist', and etc) do not support "
+          "printing with the `--printparams' (`-P'), or writing into "
+          "configuration files due to lack of time when implementing "
+          "these features. You can put them into configuration files "
+          "manually. Please get in touch with us at `%s', so we can "
+          "implement it", PACKAGE_BUGREPORT);
+
+  /* If this option is given in a configuration file, then `arg' will not
+     be NULL and we don't want to do anything if it is `0'. */
+  if(arg)
+    {
+      /* Make sure the value is only `0' or `1'. */
+      if( arg[1]!='\0' && *arg!='0' && *arg!='1' )
+        error_at_line(EXIT_FAILURE, 0, filename, lineno, "the `--%s' "
+                      "option takes no arguments. In a configuration "
+                      "file it can only have the values `1' or `0', "
+                      "indicating if it should be used or not",
+                      option->name);
+
+      /* Only proceed if the (possibly given) argument is 1. */
+      if(arg[0]=='0' && arg[1]=='\0') return NULL;
+    }
+
+  /* Add this option to the print list and return. */
+  gal_list_i32_add(option->value, option->key);
+  return NULL;
+}
+
+
+
+
+
 
 
 
@@ -223,6 +281,36 @@ ui_read_check_only_options(struct cosmiccalparams *p)
 
 
 /**************************************************************/
+/***************       Preparations         *******************/
+/**************************************************************/
+static void
+ui_preparations(struct cosmiccalparams *p)
+{
+  /* The list is filled out in a first-in-last-out order. By the time
+     control reaches here, the list is finalized. So we should just reverse
+     it so the user gets values in the same order they requested them. */
+  gal_list_i32_reverse(&p->specific);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/**************************************************************/
 /************         Set the parameters          *************/
 /**************************************************************/
 
@@ -242,7 +330,6 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
cosmiccalparams *p)
 #include <gnuastro-internal/commonopts.h>
 #include "args.h"
 
-
   /* Initialize the options and necessary information.  */
   ui_initialize_options(p, program_options, gal_commonopts_options);
 
@@ -266,4 +353,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
cosmiccalparams *p)
      after the option checks so un-sane values are not printed in the
      output state. */
   gal_options_print_state(&p->cp);
+
+
+  /* Read/allocate all the necessary starting arrays. */
+  ui_preparations(p);
 }
diff --git a/bin/cosmiccal/ui.h b/bin/cosmiccal/ui.h
index 0090fd8..40cc70f 100644
--- a/bin/cosmiccal/ui.h
+++ b/bin/cosmiccal/ui.h
@@ -23,26 +23,49 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_SPECIFIC = GAL_OPTIONS_GROUP_AFTER_COMMON,
+};
+
 
 
 
 
 /* Available letters for short options:
 
-   b c d e f g i j k n p s t u w x y
-   A B C E G J L O Q R W X Y
+   e f i j k n p t w x y
+   B E J O Q R W X Y
 */
 enum option_keys_enum
 {
   /* With short-option version. */
-  UI_KEY_REDSHIFT       = 'z',
-  UI_KEY_H0             = 'H',
-  UI_KEY_OLAMBDA        = 'l',
-  UI_KEY_OMATTER        = 'm',
-  UI_KEY_ORADIATION     = 'r',
-  UI_KEY_ONLYVOLUME     = 'v',
-  UI_KEY_ONLYABSMAGCONV = 'a',
-
+  UI_KEY_REDSHIFT            = 'z',
+  UI_KEY_H0                  = 'H',
+  UI_KEY_OLAMBDA             = 'l',
+  UI_KEY_OMATTER             = 'm',
+  UI_KEY_ORADIATION          = 'r',
+
+  UI_KEY_AGENOW              = 'G',
+  UI_KEY_CRITICALDENSITYNOW  = 'C',
+  UI_KEY_PROPERDISTANCE      = 'd',
+  UI_KEY_ANGULARDIMDIST      = 'A',
+  UI_KEY_ARCSECTANDIST       = 's',
+  UI_KEY_LUMINOSITYDIST      = 'L',
+  UI_KEY_DISTANCEMODULUS     = 'u',
+  UI_KEY_ABSMAGCONV          = 'a',
+  UI_KEY_AGE                 = 'g',
+  UI_KEY_LOOKBACKTIME        = 'b',
+  UI_KEY_CRITICALDENSITY     = 'c',
+  UI_KEY_VOLUME              = 'v',
 
   /* Only with long version (start with a value 1000, the rest will be set
      automatically). */
diff --git a/bin/crop/args.h b/bin/crop/args.h
index 83f42fa..114228e 100644
--- a/bin/crop/args.h
+++ b/bin/crop/args.h
@@ -123,7 +123,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Crop by center",
-      ARGS_GROUP_CENTER_GENERAL
+      UI_GROUP_CENTER_GENERAL
     },
     {
       "checkcenter",
@@ -131,7 +131,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Width (in pixels) of box at center to check.",
-      ARGS_GROUP_CENTER_GENERAL,
+      UI_GROUP_CENTER_GENERAL,
       &p->checkcenter,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_0_OR_ODD,
@@ -144,7 +144,7 @@ struct argp_option program_options[] =
       "FLT[,...]",
       0,
       "Width when crop is defined by its center.",
-      ARGS_GROUP_CENTER_GENERAL,
+      UI_GROUP_CENTER_GENERAL,
       &p->width,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -158,7 +158,7 @@ struct argp_option program_options[] =
       "FLT[,...]",
       0,
       "Central coordinates of a single crop.",
-      ARGS_GROUP_CENTER_GENERAL,
+      UI_GROUP_CENTER_GENERAL,
       &p->center,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -176,7 +176,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Crop by center (when a catalog is given)",
-      ARGS_GROUP_CENTER_CATALOG
+      UI_GROUP_CENTER_CATALOG
     },
     {
       "catalog",
@@ -184,7 +184,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Input catalog filename.",
-      ARGS_GROUP_CENTER_CATALOG,
+      UI_GROUP_CENTER_CATALOG,
       &p->catname,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -197,7 +197,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "HDU of catalog, if it is a FITS table.",
-      ARGS_GROUP_CENTER_CATALOG,
+      UI_GROUP_CENTER_CATALOG,
       &p->cathdu,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -210,7 +210,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Column no./info of crop filename (no suffix).",
-      ARGS_GROUP_CENTER_CATALOG,
+      UI_GROUP_CENTER_CATALOG,
       &p->namecol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -223,7 +223,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Column no./info containing coordinates.",
-      ARGS_GROUP_CENTER_CATALOG,
+      UI_GROUP_CENTER_CATALOG,
       &p->coordcol,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -238,7 +238,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Crop by region",
-      ARGS_GROUP_REGION
+      UI_GROUP_REGION
     },
     {
       "section",
@@ -246,7 +246,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Image section string specifying crop range.",
-      ARGS_GROUP_REGION,
+      UI_GROUP_REGION,
       &p->section,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -259,7 +259,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Polygon vertices of region to crop, keep inside.",
-      ARGS_GROUP_REGION,
+      UI_GROUP_REGION,
       &p->polygon,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -272,7 +272,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Keep the polygon's outside, mask the inside.",
-      ARGS_GROUP_REGION,
+      UI_GROUP_REGION,
       &p->outpolygon,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
diff --git a/bin/crop/ui.c b/bin/crop/ui.c
index 3d4a3e9..4f2acfc 100644
--- a/bin/crop/ui.c
+++ b/bin/crop/ui.c
@@ -83,19 +83,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will create 
cutouts, "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_CENTER_GENERAL = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_CENTER_SINGLE,
-  ARGS_GROUP_CENTER_CATALOG,
-  ARGS_GROUP_REGION,
-};
-
-
-
-
-
 
 
 
@@ -155,7 +142,7 @@ ui_initialize_options(struct cropparams *p,
 
         case GAL_OPTIONS_KEY_SEARCHIN:
         case GAL_OPTIONS_KEY_IGNORECASE:
-          cp->coptions[i].group=ARGS_GROUP_CENTER_CATALOG;
+          cp->coptions[i].group=UI_GROUP_CENTER_CATALOG;
           break;
         }
 
diff --git a/bin/crop/ui.h b/bin/crop/ui.h
index 46d520f..fd15de0 100644
--- a/bin/crop/ui.h
+++ b/bin/crop/ui.h
@@ -23,6 +23,22 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_CENTER_GENERAL = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_CENTER_SINGLE,
+  UI_GROUP_CENTER_CATALOG,
+  UI_GROUP_REGION,
+};
+
 
 
 
diff --git a/bin/fits/args.h b/bin/fits/args.h
index 8c71928..44abbfe 100644
--- a/bin/fits/args.h
+++ b/bin/fits/args.h
@@ -35,7 +35,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "HDUs (extensions):",
-      ARGS_GROUP_EXTENSION
+      UI_GROUP_EXTENSION
     },
     {
       "remove",
@@ -43,7 +43,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Remove extension from input file.",
-      ARGS_GROUP_EXTENSION,
+      UI_GROUP_EXTENSION,
       &p->remove,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -56,7 +56,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Copy extension to output file.",
-      ARGS_GROUP_EXTENSION,
+      UI_GROUP_EXTENSION,
       &p->copy,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -69,7 +69,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Copy extension to output and remove from input.",
-      ARGS_GROUP_EXTENSION,
+      UI_GROUP_EXTENSION,
       &p->cut,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -82,7 +82,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Keywords (in one HDU):",
-      ARGS_GROUP_KEYWORD
+      UI_GROUP_KEYWORD
     },
     {
       "asis",
@@ -90,7 +90,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Write the argument string as is into the header.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->asis,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -103,7 +103,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Delete a keyword from the header.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->delete,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -116,7 +116,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Rename keyword, keeping value and comments.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->rename,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -129,7 +129,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Update a keyword value or comments.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->update,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -142,7 +142,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Write a keyword (with value, comments and units).",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->write,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -155,7 +155,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Add HISTORY keyword, any length is ok.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->history,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -168,7 +168,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Add COMMENT keyword, any length is ok.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->comment,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -181,7 +181,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Set the DATE keyword to the current time.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->date,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -194,7 +194,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Print all keywords in the selected HDU.",
-      ARGS_GROUP_KEYWORD,
+      UI_GROUP_KEYWORD,
       &p->printallkeys,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
diff --git a/bin/fits/ui.c b/bin/fits/ui.c
index 33576d2..880ea35 100644
--- a/bin/fits/ui.c
+++ b/bin/fits/ui.c
@@ -71,14 +71,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" allows you 
to view and "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_EXTENSION = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_KEYWORD,
-};
-
-
 
 
 
diff --git a/bin/fits/ui.h b/bin/fits/ui.h
index f31ce05..390f171 100644
--- a/bin/fits/ui.h
+++ b/bin/fits/ui.h
@@ -23,6 +23,20 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_EXTENSION = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_KEYWORD,
+};
+
 
 
 
diff --git a/bin/mkcatalog/args.h b/bin/mkcatalog/args.h
index 36a7ad5..71f5562 100644
--- a/bin/mkcatalog/args.h
+++ b/bin/mkcatalog/args.h
@@ -212,7 +212,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Upper limit magnitude:",
-      ARGS_GROUP_UPPERLIMIT
+      UI_GROUP_UPPERLIMIT
     },
     {
       "upmaskfile",
@@ -220,7 +220,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Mask image file name only for upper limit.",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->upmaskfile,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -233,7 +233,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Mask image HDU only for upper limit.",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->upmaskhdu,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -246,7 +246,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Number of randomly positioned samples",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->upnum,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -259,7 +259,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Use GSL_RNG_SEED environment variable for seed.",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->envseed,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -272,7 +272,7 @@ struct argp_option program_options[] =
       "FLT,FLT",
       0,
       "Sigma multiple and, tolerance or number.",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->upsigmaclip,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -286,7 +286,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Multiple of sigma to define upperlimit.",
-      ARGS_GROUP_UPPERLIMIT,
+      UI_GROUP_UPPERLIMIT,
       &p->upnsigma,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GT_0,
@@ -302,7 +302,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Output catalog columns",
-      ARGS_GROUP_COLUMNS
+      UI_GROUP_COLUMNS
     },
     {  /* `ids' is not a unique column, it is a combination of several
           columns. */
@@ -311,7 +311,7 @@ struct argp_option program_options[] =
       0,
       0,
       "All IDs of objects and clumps.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -325,7 +325,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Object label/ID.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -339,7 +339,7 @@ struct argp_option program_options[] =
       0,
       0,
       "ID of object hosting this clump.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -353,7 +353,7 @@ struct argp_option program_options[] =
       0,
       0,
       "ID of clump in host object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -367,7 +367,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Number of clumps in this object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -381,7 +381,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Number of pixels in clump or object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -395,7 +395,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Sum of all clump areas in an object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -409,7 +409,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Area used for flux weighted positions.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -423,7 +423,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in first FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -437,7 +437,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in second FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -451,7 +451,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in third FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -465,7 +465,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in first FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -479,7 +479,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in second FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -493,7 +493,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in third FITS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -507,7 +507,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in obj. (X).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -521,7 +521,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in obj. (Y).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -535,7 +535,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in obj. (Z).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -549,7 +549,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in obj. (X).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -563,7 +563,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in obj. (Y).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -577,7 +577,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in obj. (Z).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -591,7 +591,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center right ascension.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -605,7 +605,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center declination.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -619,7 +619,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in first WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -633,7 +633,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in second WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -647,7 +647,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted center in third WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -661,7 +661,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in first WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -675,7 +675,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in second WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -689,7 +689,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center in third WCS axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -703,7 +703,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in 1st WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -717,7 +717,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in 2nd WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -731,7 +731,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux.wht center of all clumps in 3rd WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -745,7 +745,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in 1st WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -759,7 +759,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in 2nd WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -773,7 +773,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric center of all clumps in 3rd WCS.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -787,7 +787,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Brightness (sum of pixel values).",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -801,7 +801,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Brightness of clumps in an object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -815,7 +815,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Sky (not river) subtracted clump brightness.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -829,7 +829,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Total magnitude of objects or clumps.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -843,7 +843,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Magnitude error of objects or clumps.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -857,7 +857,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Magnitude of all clumps in object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -871,7 +871,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Upper-limit value, use other options to config.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -885,7 +885,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Upper-limit mag. use other options to config.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -899,7 +899,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Average river value surrounding a clump.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -913,7 +913,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Number of river pixels around a clump.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -927,7 +927,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Signal to noise ratio of objects or clumps.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -941,7 +941,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Average Sky value under this clump or object.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -955,7 +955,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Average Sky standard deviation.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -969,7 +969,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted semi-major axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -983,7 +983,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted semi-minor axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -997,7 +997,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted axis ratio.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -1011,7 +1011,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Flux weighted position angle.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -1025,7 +1025,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric semi-major axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -1039,7 +1039,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric semi-minor axis.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -1053,7 +1053,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric axis ratio.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -1067,7 +1067,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Geometric position angle.",
-      ARGS_GROUP_COLUMNS,
+      UI_GROUP_COLUMNS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 5c68f4b..9a60d88 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -76,12 +76,8 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will create 
a catalog from "
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_UPPERLIMIT = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_COLUMNS,
-};
+
+
 
 
 
diff --git a/bin/mkcatalog/ui.h b/bin/mkcatalog/ui.h
index a3cd08b..7ffc5f0 100644
--- a/bin/mkcatalog/ui.h
+++ b/bin/mkcatalog/ui.h
@@ -23,6 +23,20 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_UPPERLIMIT = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_COLUMNS,
+};
+
 
 
 
diff --git a/bin/mknoise/ui.h b/bin/mknoise/ui.h
index 38c1d1f..eed9b92 100644
--- a/bin/mknoise/ui.h
+++ b/bin/mknoise/ui.h
@@ -23,6 +23,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
 
 
 
diff --git a/bin/mkprof/args.h b/bin/mkprof/args.h
index dafea6a..b38b91b 100644
--- a/bin/mkprof/args.h
+++ b/bin/mkprof/args.h
@@ -162,7 +162,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Profiles:",
-      ARGS_GROUP_PROFILES
+      UI_GROUP_PROFILES
     },
     {
       "mode",
@@ -170,7 +170,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Mode of `--ccol': `img' or `wcs'.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->mode,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -184,7 +184,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "No. of random points in Monte Carlo integration.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->numrandom,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -197,7 +197,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Use GSL_RNG_SEED environment variable for seed.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->envseed,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -210,7 +210,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Tolerance to switch to less accurate method.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->tolerance,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -223,7 +223,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Truncation is in units of pixels, not radius.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->tunitinp,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -236,7 +236,7 @@ struct argp_option program_options[] =
       0,
       0,
       "mcol is flat pixel value (when fcol is 5 or 6)",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->mforflatpix,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -249,7 +249,7 @@ struct argp_option program_options[] =
       0,
       0,
       "mcol is total brightness, not magnitude.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->mcolisbrightness,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -262,7 +262,7 @@ struct argp_option program_options[] =
       "INT[, ...]",
       0,
       "Shift profile centers in output image.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->shift,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -276,7 +276,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Shift and expand based on first catalog PSF.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->prepforconv,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -289,7 +289,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Magnitude zero point.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->zeropoint,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
@@ -302,7 +302,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Magnitude is for peak pixel, not full profile.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->magatpeak,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -315,7 +315,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Width of circumference (inward) profiles",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->circumwidth,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GT_0,
@@ -328,7 +328,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Replace overlapping profile pixels, don't add.",
-      ARGS_GROUP_PROFILES,
+      UI_GROUP_PROFILES,
       &p->replace,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -343,7 +343,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Columns, by info (see `--searchin'), or number (starting from 1):",
-      ARGS_GROUP_CATALOG
+      UI_GROUP_CATALOG
     },
     {
       "ccol",
@@ -351,7 +351,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Coordinate columns (one call for each dimension).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->ccol,
       GAL_TYPE_STRLL,
       GAL_OPTIONS_RANGE_ANY,
@@ -365,7 +365,7 @@ struct argp_option program_options[] =
       0,
       "sersic (1), moffat (2), gaussian (3), point (4), "
       "flat (5), circumference (6), distance (7).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->fcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -378,7 +378,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Effective radius or FWHM in pixels.",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->rcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -391,7 +391,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Sersic index or Moffat beta.",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->ncol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -404,7 +404,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Position angle (First X-Z-X Euler angle in 3D).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->pcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -417,7 +417,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Second Euler angle (X-Z-X order).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->p2col,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -430,7 +430,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Third Euler angle (X-Z-X order).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->p3col,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -443,7 +443,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Axis ratio (major/dim2 radius).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->qcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -456,7 +456,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Axis ratio (major/dim3 radius).",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->q2col,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -469,7 +469,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Magnitude.",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->mcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -482,7 +482,7 @@ struct argp_option program_options[] =
       "STR/INT",
       0,
       "Truncation in units of --rcol, unless --tunitinp.",
-      ARGS_GROUP_CATALOG,
+      UI_GROUP_CATALOG,
       &p->tcol,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -497,7 +497,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "WCS parameters:",
-      ARGS_GROUP_WCS
+      UI_GROUP_WCS
     },
     {
       "crpix",
@@ -505,7 +505,7 @@ struct argp_option program_options[] =
       "FLT[, ...]",
       0,
       "Pixel coordinates of reference point.",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->crpix,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -519,7 +519,7 @@ struct argp_option program_options[] =
       "FLT[, ...]",
       0,
       "WCS coordinates of reference point.",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->crval,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -533,7 +533,7 @@ struct argp_option program_options[] =
       "FLT[, ...]",
       0,
       "Resolution in each dimension.",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->cdelt,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -547,7 +547,7 @@ struct argp_option program_options[] =
       "FLT[, ...]",
       0,
       "WCS rotation matrix (all elements).",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->pc,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -561,7 +561,7 @@ struct argp_option program_options[] =
       "STR[, ... ]",
       0,
       "Units of the WCS coordinates (e.g., `deg').",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->cunit,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -575,7 +575,7 @@ struct argp_option program_options[] =
       "STR[, ... ]",
       0,
       "One of FITS standard WCS types.",
-      ARGS_GROUP_WCS,
+      UI_GROUP_WCS,
       &p->ctype,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 06dba85..c4d1b1d 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -79,17 +79,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will create 
a FITS image "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_PROFILES = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_CATALOG,
-  ARGS_GROUP_WCS,
-};
-
-
-
-
 
 
 
diff --git a/bin/mkprof/ui.h b/bin/mkprof/ui.h
index 2a7b791..dbb116b 100644
--- a/bin/mkprof/ui.h
+++ b/bin/mkprof/ui.h
@@ -23,6 +23,21 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_PROFILES = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_CATALOG,
+  UI_GROUP_WCS,
+};
+
 
 
 
diff --git a/bin/noisechisel/args.h b/bin/noisechisel/args.h
index cf9934b..d672e28 100644
--- a/bin/noisechisel/args.h
+++ b/bin/noisechisel/args.h
@@ -179,7 +179,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Detection:",
-      ARGS_GROUP_DETECTION
+      UI_GROUP_DETECTION
     },
     {
       "mirrordist",
@@ -187,7 +187,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Max. dist. (error multip.) to find mode.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->mirrordist,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
@@ -200,7 +200,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Max. mode and median quant diff. per tile.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->modmedqdiff,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0,
@@ -213,7 +213,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Quantile threshold on convolved image.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->qthresh,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LT_1,
@@ -226,7 +226,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Remove tiles at higher quantiles.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->qthreshtilequant,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -239,7 +239,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Flat kernel width to smooth interpolated.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->smoothwidth,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_0_OR_ODD,
@@ -252,7 +252,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save quantile threshold estimation in file.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->checkqthresh,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -265,7 +265,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Number of erosions after thresholding.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->erode,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GE_0,
@@ -278,7 +278,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "4 or 8 connectivity in erosion.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->erodengb,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -291,7 +291,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Quantile for no erosion.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->noerodequant,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -304,7 +304,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Depth of opening after erosion.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->opening,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -317,7 +317,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "4 or 8 connectivity in opening.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->openingngb,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -330,7 +330,7 @@ struct argp_option program_options[] =
       "FLT,FLT",
       0,
       "Sigma multiple and, tolerance or number.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->sigmaclip,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -344,7 +344,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save Sky value estimation for pseudo-dets.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->checkdetsky,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -357,7 +357,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Sigma threshold for Pseudo-detections.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->dthresh,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
@@ -370,7 +370,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Min. pseudo-detection area for S/N dist.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->detsnminarea,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_ANY,
@@ -383,7 +383,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save pseudo-detection S/N values to a file.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->checkdetsn,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -396,7 +396,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Quantile in pseudo-det. to define true.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->detquant,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GT_0_LT_1,
@@ -409,7 +409,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Minimum quant. to expand true detections.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->detgrowquant,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -422,7 +422,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Max. area of holes after growth to fill.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->detgrowmaxholesize,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GE_0,
@@ -435,7 +435,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Remove small S/N grown detections.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->cleangrowndet,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_ANY,
@@ -448,7 +448,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save all the detection steps to a file.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->checkdetection,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -461,7 +461,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Final sky and its STD steps in a file.",
-      ARGS_GROUP_DETECTION,
+      UI_GROUP_DETECTION,
       &p->checksky,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -475,7 +475,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Segmentation:",
-      ARGS_GROUP_SEGMENTATION
+      UI_GROUP_SEGMENTATION
     },
     {
       "segsnminarea",
@@ -483,7 +483,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Minimum area of clumps for S/N estimation.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->segsnminarea,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -496,7 +496,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save Sky clump S/N values into a file.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->checkclumpsn,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -509,7 +509,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "S/N Quantile of true sky clumps.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->segquant,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GT_0,
@@ -522,7 +522,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Keep clumps with peak touching a river.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->keepmaxnearriver,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -535,7 +535,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Multiple of STD to stop growing clumps.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->gthresh,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
@@ -548,7 +548,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Minimum len of useful grown clump rivers.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->minriverlength,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_ANY,
@@ -561,7 +561,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Min. S/N for grown clumps as one object.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->objbordersn,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0,
@@ -574,7 +574,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Store segmentation steps in a file.",
-      ARGS_GROUP_SEGMENTATION,
+      UI_GROUP_SEGMENTATION,
       &p->checksegmentation,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index 0d6efa8..4f315ac 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -74,12 +74,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" Detects and 
segments signal "
   PACKAGE_NAME" home page: "PACKAGE_URL;
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_DETECTION = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_SEGMENTATION,
-};
 
 
 
diff --git a/bin/noisechisel/ui.h b/bin/noisechisel/ui.h
index c8209ae..9481981 100644
--- a/bin/noisechisel/ui.h
+++ b/bin/noisechisel/ui.h
@@ -23,6 +23,20 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_DETECTION = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_SEGMENTATION,
+};
+
 
 
 
diff --git a/bin/statistics/args.h b/bin/statistics/args.h
index 32c558c..12cfc2d 100644
--- a/bin/statistics/args.h
+++ b/bin/statistics/args.h
@@ -121,7 +121,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Single value measurements",
-      ARGS_GROUP_SINGLE_VALUE
+      UI_GROUP_SINGLE_VALUE
     },
     {
       "number",
@@ -129,7 +129,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Number (non-blank).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_ANY,
@@ -143,7 +143,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Minimum.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -157,7 +157,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Maximum.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -171,7 +171,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Sum.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -185,7 +185,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Mean.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -199,7 +199,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Standad deviation.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -213,7 +213,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Median.",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -227,7 +227,7 @@ struct argp_option program_options[] =
       "FLT[,...]",
       0,
       "Quantile (multiple values acceptable).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -241,7 +241,7 @@ struct argp_option program_options[] =
       "FLT[,...]",
       0,
       "Quantile function (multiple values acceptable).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0_LE_1,
@@ -255,7 +255,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Mode (Appendix C of arXiv:1505.01664).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -269,7 +269,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Mode quantile (see --mode)",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -283,7 +283,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Mode symmetricity (see --mode).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -297,7 +297,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Value at mode symmetricity (see --mode).",
-      ARGS_GROUP_SINGLE_VALUE,
+      UI_GROUP_SINGLE_VALUE,
       &p->singlevalue,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -312,7 +312,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Particular calculation",
-      ARGS_GROUP_PARTICULAR_STAT
+      UI_GROUP_PARTICULAR_STAT
     },
     {
       "asciihist",
@@ -320,7 +320,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Print an ASCII histogram.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->asciihist,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -333,7 +333,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Print an ASCII cumulative frequency plot.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->asciicfp,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -346,7 +346,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save the histogram in output.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->histogram,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -359,7 +359,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Save the cumulative frequency plot in output.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->cumulative,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -372,7 +372,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Save the histogram and CFP of the mirror dist.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->mirror,
       GAL_TYPE_FLOAT64,
       GAL_OPTIONS_RANGE_ANY,
@@ -385,7 +385,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Single values on separate tiles, not full input.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->ontile,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -398,7 +398,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Find the Sky and its STD over the tessellation.",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->sky,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -411,7 +411,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Overall sigma-clipping (see `--sclipparams')",
-      ARGS_GROUP_PARTICULAR_STAT,
+      UI_GROUP_PARTICULAR_STAT,
       &p->sigmaclip,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -426,7 +426,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Sky and Sky STD settings",
-      ARGS_GROUP_SKY
+      UI_GROUP_SKY
     },
     {
       "kernel",
@@ -434,7 +434,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "File name of kernel to convolve input.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->kernelname,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -447,7 +447,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "HDU/extension name or number of kernel.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->khdu,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -460,7 +460,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Max. distance (error multip.) to find mode.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->mirrordist,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
@@ -473,7 +473,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Max. mode and median quantile diff. per tile.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->modmedqdiff,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_GE_0,
@@ -486,7 +486,7 @@ struct argp_option program_options[] =
       "FLT,FLT",
       0,
       "Sigma clip: Multiple, and tolerance/number.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       p->sclipparams,
       GAL_TYPE_STRING,
       GAL_OPTIONS_RANGE_ANY,
@@ -500,7 +500,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Sky: flat kernel width to smooth interpolated.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->smoothwidth,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_0_OR_ODD,
@@ -513,7 +513,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Store steps in `_sky_steps.fits' file.",
-      ARGS_GROUP_SKY,
+      UI_GROUP_SKY,
       &p->checksky,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
@@ -527,7 +527,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Histogram and CFP settings",
-      ARGS_GROUP_HIST_CFP
+      UI_GROUP_HIST_CFP
     },
     {
       "numbins",
@@ -535,7 +535,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "No. of bins in histogram or CFP tables.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->numbins,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -548,7 +548,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "No. of bins in ASCII histogram or CFP plots.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->numasciibins,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -561,7 +561,7 @@ struct argp_option program_options[] =
       "INT",
       0,
       "Height of ASCII histogram or CFP plots.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->asciiheight,
       GAL_TYPE_SIZE_T,
       GAL_OPTIONS_RANGE_GT_0,
@@ -574,7 +574,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Set sum of all bins to 1.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->normalize,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_GT_0,
@@ -587,7 +587,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Scale such that the maximum bin has value of one.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->maxbinone,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_GT_0,
@@ -600,7 +600,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Shift bins so one bin starts on this value.",
-      ARGS_GROUP_HIST_CFP,
+      UI_GROUP_HIST_CFP,
       &p->onebinstart,
       GAL_TYPE_FLOAT32,
       GAL_OPTIONS_RANGE_ANY,
diff --git a/bin/statistics/ui.c b/bin/statistics/ui.c
index d1a9de9..cc6f0b6 100644
--- a/bin/statistics/ui.c
+++ b/bin/statistics/ui.c
@@ -38,7 +38,6 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <gnuastro/statistics.h>
 
 #include <gnuastro-internal/timing.h>
-#include <gnuastro-internal/options.h>
 #include <gnuastro-internal/checkset.h>
 #include <gnuastro-internal/tableintern.h>
 #include <gnuastro-internal/fixedstringmacros.h>
@@ -85,14 +84,7 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will do 
statistical "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_SINGLE_VALUE = GAL_OPTIONS_GROUP_AFTER_COMMON,
-  ARGS_GROUP_PARTICULAR_STAT,
-  ARGS_GROUP_SKY,
-  ARGS_GROUP_HIST_CFP,
-};
+
 
 
 
@@ -225,8 +217,9 @@ ui_add_to_single_value(struct argp_option *option, char 
*arg,
           "(like `--number', `--mean', and etc) do not support printing "
           "with the `--printparams' (`-P'), or writing into configuration "
           "files due to lack of time when implementing these features. "
-          "Please get in touch with us at `%s', so we can implement it if "
-          "it is possible now, thank you", PACKAGE_BUGREPORT);
+          "You can put them into configuration files manually. Please get "
+          "in touch with us at `%s', so we can implement it",
+          PACKAGE_BUGREPORT);
 
   /* Some of these options take values and some don't. */
   if(option->type==GAL_OPTIONS_NO_ARG_TYPE)
diff --git a/bin/statistics/ui.h b/bin/statistics/ui.h
index d81efa4..64b4cea 100644
--- a/bin/statistics/ui.h
+++ b/bin/statistics/ui.h
@@ -23,6 +23,22 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_SINGLE_VALUE = GAL_OPTIONS_GROUP_AFTER_COMMON,
+  UI_GROUP_PARTICULAR_STAT,
+  UI_GROUP_SKY,
+  UI_GROUP_HIST_CFP,
+};
+
 
 
 
diff --git a/bin/table/ui.h b/bin/table/ui.h
index 5637881..15f4bbb 100644
--- a/bin/table/ui.h
+++ b/bin/table/ui.h
@@ -23,6 +23,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
 
 
 
diff --git a/bin/warp/args.h b/bin/warp/args.h
index 195e7fd..2c028a6 100644
--- a/bin/warp/args.h
+++ b/bin/warp/args.h
@@ -94,7 +94,7 @@ struct argp_option program_options[] =
     {
       0, 0, 0, 0,
       "Warps:",
-      ARGS_GROUP_WARPS
+      UI_GROUP_WARPS
     },
     {
       "align",
@@ -102,7 +102,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Align the image and celestial axes.",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -116,7 +116,7 @@ struct argp_option program_options[] =
       "FLT",
       0,
       "Rotate by the given angle in degrees.",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -130,7 +130,7 @@ struct argp_option program_options[] =
       "FLT[,FLT]",
       0,
       "Scale along the given axis(es).",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -144,7 +144,7 @@ struct argp_option program_options[] =
       "INT[,INT]",
       0,
       "Flip along the given axis(es).",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -158,7 +158,7 @@ struct argp_option program_options[] =
       "FLT[,FLT]",
       0,
       "Shear along the given axis(es).",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -172,7 +172,7 @@ struct argp_option program_options[] =
       "FLT[,FLT]",
       0,
       "Translate along the given axis(es).",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -186,7 +186,7 @@ struct argp_option program_options[] =
       "FLT[,FLT]",
       0,
       "Project along the given axis(es).",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       0,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -200,7 +200,7 @@ struct argp_option program_options[] =
       "STR",
       0,
       "Raw transformation matrix, highest priority.",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       &p->matrix,
       GAL_TYPE_INVALID,
       GAL_OPTIONS_RANGE_ANY,
@@ -214,7 +214,7 @@ struct argp_option program_options[] =
       0,
       0,
       "Center of coordinates on first pixel corner.",
-      ARGS_GROUP_WARPS,
+      UI_GROUP_WARPS,
       &p->centeroncorner,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
diff --git a/bin/warp/ui.c b/bin/warp/ui.c
index 0d72447..a830b0b 100644
--- a/bin/warp/ui.c
+++ b/bin/warp/ui.c
@@ -75,15 +75,6 @@ doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will 
warp/transform the "
 
 
 
-/* Option groups particular to this program. */
-enum program_args_groups
-{
-  ARGS_GROUP_WARPS = GAL_OPTIONS_GROUP_AFTER_COMMON,
-};
-
-
-
-
 
 
 
diff --git a/bin/warp/ui.h b/bin/warp/ui.h
index a8b140d..f78f203 100644
--- a/bin/warp/ui.h
+++ b/bin/warp/ui.h
@@ -23,6 +23,19 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef UI_H
 #define UI_H
 
+/* For common options groups. */
+#include <gnuastro-internal/options.h>
+
+
+
+
+
+/* Option groups particular to this program. */
+enum program_args_groups
+{
+  UI_GROUP_WARPS = GAL_OPTIONS_GROUP_AFTER_COMMON,
+};
+
 
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 96c3bc3..bb44736 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -514,6 +514,11 @@ CosmicCalculator
 * Extending distance concepts to 3D::  Going to 3D (our real universe).
 * Invoking astcosmiccal::       How to run CosmicCalculator
 
+Invoking CosmicCalculator
+
+* CosmicCalculator input options::  Options to specify input conditions.
+* CosmicCalculator specific calculations::  Requesting specific outputs.
+
 Library
 
 * Review of library fundamentals::  Guide on libraries and linking.
@@ -16717,50 +16722,42 @@ One line examples:
 $ astcosmiccal -z2.5
 
 ## Only print Comoving volume over 4pi stradian to z (Mpc^3):
-$ astcosmiccal --onlyvolume --redshift=0.8
+$ astcosmiccal --redshift=0.8 --volume
+
+## Print luminosity distance, angular diameter distance and age
+## of universe in one row at redshift 0.4
+$ astcosmiccal -z0.4 -LAg
 
 ## Assume Lambda and matter density of 0.7 and 0.3 and print
 ## basic cosmological parameters for redshift 2.1:
 $ astcosmiccal -l0.7 -m0.3 -z2.1
 @end example
 
-The input parameters can be given as command-line options or in the
-configuration files, see @ref{Configuration files}. For a definition
-of the different parameters, please see the sections prior to this. By
-default, all the cosmological calculations will be printed in the
-standard output (the command-line mainly) along with a short
-description and units.
-
-The options starting with @option{--only} will only do that single
-desired calculation and only print the final number (in the same units
-as reported by default). These options are very useful when you want
-to call CosmicCalculator from a script. The resulting number can
-simply be put into a shell variable (for example @code{vol}) with the
-following line, which will allow you to use the value for any other
-subsequent operation.
+The input parameters (for example current matter density and etc) can be
+given as command-line options or in the configuration files, see
+@ref{Configuration files}. For a definition of the different parameters,
+please see the sections prior to this. If no redshift is given,
+CosmicCalculator will just print its input parameters and abort. For a full
+list of the input options, please see @ref{CosmicCalculator input options}.
 
-@example
-z=3.12
-vol=$(astcosmiccal --redshift=$z --onlyvolume)
-@end example
+When only a redshift is given, CosmicCalculator will print all calculations
+(one per line) with some explanations before each. This can be good when
+you want a general feeling of the conditions at a specific
+redshift. Alternatively, if any specific calculations are requested, only
+the requested values will be calculated and printed with one character
+space between them. In this case, no description will be printed. See
+@ref{CosmicCalculator specific calculations} for the full list of these
+options along with some explanations how when/how they can be useful.
 
-@cindex GNU Grep
-@noindent
-In a script, this operation might be necessary for a very large number
-of objects (thousands of galaxies in a catalog for example). So the
-fact that all the other default calculations are ignored will also
-help you get to your result faster. If you just want to inspect the
-value of a variable, the description (which comes with units) might be
-more useful. In that case, the following command might be better. The
-other parameters will also be calculated, but they are so fast that
-you will not notice on modern computers.
+@menu
+* CosmicCalculator input options::  Options to specify input conditions.
+* CosmicCalculator specific calculations::  Requesting specific outputs.
+@end menu
 
-@example
-$ astcosmiccal --redshift=0.832 | grep volume
-@end example
+@node CosmicCalculator input options, CosmicCalculator specific calculations, 
Invoking astcosmiccal, Invoking astcosmiccal
+@subsubsection CosmicCalculator input options
 
-@noindent
-The full list of options is shown and described below:
+The inputs to CosmicCalculator can be specified with the following options:
 @table @option
 
 @item -z FLT
@@ -16785,20 +16782,141 @@ density in the current Universe 
(@mymath{\Omega_{m,0}}).
 @itemx --oradiation=FLT
 Radiation density divided by the critical density in the current Universe
 (@mymath{\Omega_{r,0}}).
+@end table
+
 
-@item -v
-@itemx --onlyvolume
-Only print the comoving volume (in units of Mpc@mymath{^3}) until the
-desired redshift based on the input parameters. See explanations above
-for more on these types of options and how to effectively use them.
+
+@node CosmicCalculator specific calculations,  , CosmicCalculator input 
options, Invoking astcosmiccal
+@subsubsection CosmicCalculator specific calculations
+By default, when no specific calculations are requested, CosmicCalculator
+will print a complete set of all its calculators (one line for each
+calculation, see @ref{Invoking astcosmiccal}). The full list of
+calculations can be useful when you don't want any specific value, but just
+a general view. In other contexts (for example in a batch script or during
+a discussion), you know exactly what you want and don't want to be
+distracted by all the extra information.
+
+You can use any number of the options described below in any order. When
+any of these options are requested, CosmicCalculator's output will just be
+a single line with a single space between the (possibly) multiple
+values. In the example below, only the tangential distance along one
+arcsecond (in kpc), absolute magnitude conversion, and age of the universe
+at redshift 2 are printed (recall that you can merge short options
+together, see @ref{Options}).
+
+@example
+$ astcosmiccal -z2 -sag
+8.585046 44.819248 3.289979
+@end example
+
+Here is one example of using this feature in scripts: by adding the
+following two lines in a script to keep/use the comoving volume with
+varying redshifts:
+
+@example
+z=3.12
+vol=$(astcosmiccal --redshift=$z --volume)
+@end example
+
+@cindex GNU Grep
+@noindent
+In a script, this operation might be necessary for a large number of
+objects (several of galaxies in a catalog for example). So the fact that
+all the other default calculations are ignored will also help you get to
+your result faster.
+
+If you are indeed dealing with many (for example thousands) of redshifts,
+using CosmicCalculator is not the best/fastest solution. Because it has to
+go through all the configuration files and preparations for each
+invocation. To get the best efficiency (least overhead), we recommend using
+Gnuastro's cosmology library (see @ref{Cosmology
+library}). CosmicCalculator also calls the library functions defined there
+for its calculations, so you get the same result with no overhead. Gnuastro
+also has libraries for easily reading tables into a C program, see
+@ref{Table input output}. Afterwards, you can easily build and run your C
+program for the particular processing with @ref{BuildProgram}.
+
+If you just want to inspect the value of a variable visually, the
+description (which comes with units) might be more useful. In such cases,
+the following command might be better. The other calculations will also be
+done, but they are so fast that you will not notice on modern computers
+(the time it takes your eye to focus on the result is usually longer than
+the processing: a fraction of a second).
+
+@example
+$ astcosmiccal --redshift=0.832 | grep volume
+@end example
+
+The full list of CosmicCalculator's specific calculations is present
+below. In case you have forgot the units, you can use the @option{--help}
+option which has the units along with a short description.
+
+@table @option
+
+@item -G
+@itemx --agenow
+The current age of the universe (given the input parameters) in Giga-years
+(Gyr).
+
+@item -C
+@itemx --criticaldensitynow
+The current critical density (given the input parameters) in grams per
+centimeter-cube (@mymath{g/cm^3}).
 
 @item -d
-@itemx --onlyabsmagconv
-Only print the conversion factor for apparent magnitude to absolute
-magnitude. Note that this is practically the distance modulus added
-with @mymath{-2.5\log{(1+z)}} for the the desired redshift based on
-the input parameters. See explanations above for more on these types
-of options and how to effectively use them.
+@itemx --properdistance
+The proper distance (at current time) to object at the given redshift in
+Megaparsecs (Mpc). See @ref{Distance on a 2D curved space} for a
+description of the proper distance.
+
+@item -A
+@itemx --angulardimdist
+The angular diameter distance to object at given redshift in Megaparsecs
+(Mpc).
+
+@item -s
+@itemx --arcsectandist
+The tangential distance covered by 1 arcseconds at the given redshift in
+kiloparsecs (Kpc). This can be useful when trying to estimate the
+resolution or pixel scale of an instrument (usually in units of arcseconds)
+at a given redshift.
+
+@item -L
+@itemx --luminositydist
+The luminosity distance to object at given redshift in Megaparsecs (Mpc).
+
+@item -u
+@itemx --distancemodulus
+The distance modulus at given redshift.
+
+@item -a
+@itemx --absmagconv
+The conversion factor (addition) to absolute magnitude. Note that this is
+practically the distance modulus added with @mymath{-2.5\log{(1+z)}} for
+the the desired redshift based on the input parameters. Once the apparent
+magnitude and redshift of an object is known, this value may be added with
+the apparent magnitdue to give the object's absolute magnitude.
+
+@item -g
+@itemx --age
+Age of the universe at given redshift in Giga-years (Gyr).
+
+@item -b
+@itemx --lookbacktime
+The look-back time to given redshift in Giga-years (Gyr). The look-back
+time at a given redshift is defined as the current age of the universe
+(@option{--agenow}) subtracted by the age of the universe at the given
+redshift.
+
+@item -c
+@itemx --criticaldensity
+The critical density at given redshift in grams per centimeter-cube
+(@mymath{g/cm^3}).
+
+@item -v
+@itemx --onlyvolume
+The comoving volume in Megaparsecs cube (Mpc@mymath{^3}) until the desired
+redshift based on the input parameters.
 
 @end table
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]