gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master c942760: All programs write their configuratio


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master c942760: All programs write their configuration in FITS output
Date: Fri, 10 Aug 2018 20:04:20 -0400 (EDT)

branch: master
commit c942760ec4bc290dd6b09b5aa13754e9f1cdae7a
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    All programs write their configuration in FITS output
    
    In the previous two commits, a feature was added to NoiseChisel and Segment
    to write their input configuration options into the output FITS file. But
    those functions were very basic and we had to manually go through all the
    options and their names, value pointers and documentation. Maintaining this
    list (keeping it in sync with the option updates) was a nightmare: with a
    high potential of human error.
    
    But the whole process was basically identical to the --printparams (or
    `-P') option. So the `gal_options_as_fits_keywords' was added to the
    internal `lib/options.c' library to write all the input values into a
    `gal_fits_list_key_t' list at the start of all programs. A new
    `gal_fits_key_write_config' function was also created to allow easy writing
    of this keyword list into the zero-th extension of the output FITS files.
    
    The old "Output headers" section in the book was also re-written to
    describe this new feature, and thus its now called "Output FITS files".
---
 NEWS                            |  17 ++--
 bin/convolve/convolve.c         |   6 ++
 bin/convolve/ui.c               |   4 +
 bin/crop/onecrop.c              |   2 +-
 bin/match/match.c               |  13 ++-
 bin/match/ui.c                  |  33 ++++---
 bin/mkcatalog/mkcatalog.c       |  25 +++---
 bin/mkcatalog/ui.c              |   6 ++
 bin/mknoise/mknoise.c           |   9 +-
 bin/mknoise/ui.c                |   4 +
 bin/mkprof/args.h               |   4 +-
 bin/mkprof/astmkprof.conf       |   2 +-
 bin/mkprof/mkprof.c             |   5 ++
 bin/mkprof/ui.c                 |  14 +--
 bin/mkprof/ui.h                 |   2 +-
 bin/noisechisel/noisechisel.c   | 147 ++-----------------------------
 bin/noisechisel/ui.c            |   4 +
 bin/segment/segment.c           | 135 ++---------------------------
 bin/segment/ui.c                |   4 +
 bin/statistics/sky.c            |   3 +
 bin/statistics/statistics.c     |   9 ++
 bin/statistics/ui.c             |   4 +
 bin/warp/ui.c                   |   4 +
 bin/warp/warp.c                 |   7 +-
 doc/gnuastro.texi               | 187 ++++++++++++++++++++++++++--------------
 lib/fits.c                      |  75 +++++++++++++---
 lib/gnuastro-internal/options.h |   7 ++
 lib/gnuastro/fits.h             |   6 +-
 lib/options.c                   |  81 +++++++++++++++++
 tests/during-dev.sh             |   8 +-
 tests/mkprof/mosaic1.sh         |   4 +-
 tests/mkprof/mosaic2.sh         |   3 +-
 tests/mkprof/mosaic3.sh         |   2 +-
 tests/mkprof/mosaic4.sh         |   2 +-
 tests/mkprof/radeccat.sh        |   2 +-
 35 files changed, 441 insertions(+), 399 deletions(-)

diff --git a/NEWS b/NEWS
index 970c16a..b3cdc2d 100644
--- a/NEWS
+++ b/NEWS
@@ -4,25 +4,32 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
 ** New features
 
-  NoiseChisel:
-   - Input files and parameters written in first FITS extension.
-
-  Segment:
-   - Input files and parameters written in first FITS extension.
+  All programs:
+   - Input files and parameters written as keywords in the first extension
+     of output when it is FITS. This is only relevant for some programs,
+     (for example not the Fits or Table programs).
 
   Library:
     -- gal_fits_key_list_reverse: Reverse the given list of FITS keywords.
     -- gal_fits_key_write_title_in_ptr: Write a two-line title in FITS 
keywords.
     -- gal_fits_key_write_in_ptr: New name of gal_fits_key_write.
     -- gal_fits_key_write_version_in_ptr: new name of 
gal_fits_key_write_version.
+    -- gal_fits_key_write_config: write key list and version as config header.
 
 ** Removed features
 
 ** Changed features
 
+  MakeProfiles:
+    --mergedsize: new name for the old `--naxis' option. Since the option
+          names and values are now written into the FITS header of the
+          output, this option's name would get confused with the mandatory
+          FITS keyword `NAXIS'.
+
   Library:
     -- gal_fits_key_write: filename and hdu instead of FITS pointer.
     -- gal_fits_key_write_version: filename and hdu instead of FITS pointer.
+    -- gal_fits_key_write_filename: write at the top or end of the input list.
 
 ** Bugs fixed
 
diff --git a/bin/convolve/convolve.c b/bin/convolve/convolve.c
index ae23711..fae4a18 100644
--- a/bin/convolve/convolve.c
+++ b/bin/convolve/convolve.c
@@ -797,4 +797,10 @@ convolve(struct convolveparams *p)
   /* Save the output (which is in p->input) array. */
   gal_fits_img_write_to_type(p->input, cp->output, NULL, PROGRAM_NAME,
                              cp->type);
+
+  /* Write Convolve's parameters as keywords into the first extension of
+     the output. */
+  gal_fits_key_write_filename("input", p->filename, &cp->okeys, 1);
+  gal_fits_key_write_config(&cp->okeys, "Convolve configuration",
+                            "CONVOLVE-CONFIG", cp->output, "0");
 }
diff --git a/bin/convolve/ui.c b/bin/convolve/ui.c
index 75e4774..d2b3cf1 100644
--- a/bin/convolve/ui.c
+++ b/bin/convolve/ui.c
@@ -531,6 +531,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
convolveparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/crop/onecrop.c b/bin/crop/onecrop.c
index 87d5099..9b97718 100644
--- a/bin/crop/onecrop.c
+++ b/bin/crop/onecrop.c
@@ -800,7 +800,7 @@ onecrop(struct onecropparams *crp)
       /* A section has been added to the cropped image from this input
          image, so save the information of this image. */
       sprintf(basekeyname, "ICF%zu", crp->numimg);
-      gal_fits_key_write_filename(basekeyname, img->name, &headers);
+      gal_fits_key_write_filename(basekeyname, img->name, &headers, 0);
       sprintf(regionkey, "%sPIX", basekeyname);
       gal_fits_key_list_add_end(&headers, GAL_TYPE_STRING, regionkey,
                                 0, region, 0, "Range of pixels used for "
diff --git a/bin/match/match.c b/bin/match/match.c
index 44c685c..011de6c 100644
--- a/bin/match/match.c
+++ b/bin/match/match.c
@@ -184,7 +184,7 @@ match_catalog_write_one(struct matchparams *p, gal_data_t 
*a, gal_data_t *b,
 
   /* Reverse the table and write it out. */
   gal_list_data_reverse(&cat);
-  gal_table_write(cat, NULL, p->cp.tableformat, p->cp.output, "MATCHED", 0);
+  gal_table_write(cat, NULL, p->cp.tableformat, p->out1name, "MATCHED", 0);
 }
 
 
@@ -308,6 +308,17 @@ match_catalog(struct matchparams *p)
 void
 match(struct matchparams *p)
 {
+  /* Do the correct type of matching. */
   if(p->mode==MATCH_MODE_CATALOG)
     match_catalog(p);
+
+  /* Write Match's configuration as keywords into the first extension of
+     the output. */
+  if(gal_fits_name_is_fits(p->out1name))
+    {
+      gal_fits_key_write_filename("input1", p->input1name, &p->cp.okeys, 1);
+      gal_fits_key_write_filename("input2", p->input2name, &p->cp.okeys, 1);
+      gal_fits_key_write_config(&p->cp.okeys, "Match configuration",
+                                "MATCH-CONFIG", p->out1name, "0");
+    }
 }
diff --git a/bin/match/ui.c b/bin/match/ui.c
index 69691af..a6dbcd6 100644
--- a/bin/match/ui.c
+++ b/bin/match/ui.c
@@ -493,9 +493,8 @@ ui_read_columns(struct matchparams *p)
      names. */
   for(i=0;i<ccol1n;++i)
     {
-      gal_list_str_add(&cols1, strarr1[i], 0);
-      gal_list_str_add(&cols2, strarr2[i], 0);
-      strarr1[i]=strarr2[i]=NULL;  /* So they are not freed later. */
+      gal_list_str_add(&cols1, strarr1[i], 1);
+      gal_list_str_add(&cols2, strarr2[i], 1);
     }
   gal_list_str_reverse(&cols1);
   gal_list_str_reverse(&cols2);
@@ -518,9 +517,6 @@ ui_read_columns(struct matchparams *p)
   /* Free the extra spaces. */
   gal_list_str_free(cols1, 1);
   gal_list_str_free(cols2, 1);
-  gal_data_free(p->ccol1);
-  gal_data_free(p->ccol2);
-  p->ccol1=p->ccol2=NULL;
 }
 
 
@@ -570,7 +566,6 @@ ui_preparations_out_name(struct matchparams *p)
   /* Set the output file(s) name(s). */
   if(p->logasoutput)
     {
-      /* Set the logname (as output). */
       if(p->cp.output)
         gal_checkset_allocate_copy(p->cp.output, &p->logname);
       else
@@ -584,17 +579,24 @@ ui_preparations_out_name(struct matchparams *p)
         }
 
       /* Make sure a file with this name doesn't exist. */
-      gal_checkset_writable_remove(p->out1name, 0, p->cp.dontdelete);
+      gal_checkset_writable_remove(p->logname, 0, p->cp.dontdelete);
+
+      /* The main output name needs to be available in p->out1name (for the
+         final step when we want to write the input configurations as FITS
+         keywords). */
+      gal_checkset_allocate_copy(p->logname, &p->out1name);
     }
   else
     {
       if(p->outcols)
         {
-          if(p->cp.output==NULL)
-            p->cp.output = gal_checkset_automatic_output(&p->cp,
+          if(p->cp.output)
+            gal_checkset_allocate_copy(p->cp.output, &p->out1name);
+          else
+            p->out1name = gal_checkset_automatic_output(&p->cp,
                  p->input1name, ( p->cp.tableformat==GAL_TABLE_FORMAT_TXT
                                   ? "_matched.txt" : "_matched.fits") );
-          gal_checkset_writable_remove(p->cp.output, 0, p->cp.dontdelete);
+          gal_checkset_writable_remove(p->out1name, 0, p->cp.dontdelete);
         }
       else
         {
@@ -756,6 +758,13 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
matchparams *p)
 
   /* Read/allocate all the necessary starting arrays. */
   ui_preparations(p);
+
+
+  /* If the output is a FITS table, prepare all the options as FITS
+     keywords to write in output later. */
+  if(gal_fits_name_is_fits(p->out1name))
+      gal_options_as_fits_keywords(&p->cp);
+
 }
 
 
@@ -788,6 +797,8 @@ ui_free_report(struct matchparams *p, struct timeval *t1)
   free(p->out1name);
   free(p->out2name);
   free(p->cp.output);
+  gal_data_free(p->ccol1);
+  gal_data_free(p->ccol2);
 
   /* Print the final message.
   if(!p->cp.quiet)
diff --git a/bin/mkcatalog/mkcatalog.c b/bin/mkcatalog/mkcatalog.c
index fd41bee..d88d5ca 100644
--- a/bin/mkcatalog/mkcatalog.c
+++ b/bin/mkcatalog/mkcatalog.c
@@ -610,15 +610,10 @@ mkcatalog_write_outputs(struct mkcatalogparams *p)
   gal_list_str_t *comments;
 
 
-  /* OBJECT CATALOG
-     ============== */
+  /* OBJECT catalog */
   comments=mkcatalog_outputs_same_start(p, 0, "Detection");
 
-
-  /* Write objects catalog
-     ---------------------
-
-     Reverse the comments list (so it is printed in the same order here),
+  /* Reverse the comments list (so it is printed in the same order here),
      write the objects catalog and free the comments. */
   gal_list_str_reverse(&comments);
   gal_table_write(p->objectcols, comments, p->cp.tableformat, p->objectsout,
@@ -626,9 +621,7 @@ mkcatalog_write_outputs(struct mkcatalogparams *p)
   gal_list_str_free(comments, 1);
 
 
-
-  /* CLUMPS CATALOG
-     ============== */
+  /* CLUMPS catalog */
   if(p->clumps)
     {
       /* Make the comments. */
@@ -645,7 +638,17 @@ mkcatalog_write_outputs(struct mkcatalogparams *p)
       gal_list_str_free(comments, 1);
     }
 
-  /* Inform the user. */
+
+  /* Configuration information. */
+  if(gal_fits_name_is_fits(p->objectsout))
+    {
+      gal_fits_key_write_filename("input", p->objectsfile, &p->cp.okeys, 1);
+      gal_fits_key_write_config(&p->cp.okeys, "MakeCatalog configuration",
+                                "MKCATALOG-CONFIG", p->objectsout, "0");
+    }
+
+
+  /* Inform the user */
   if(!p->cp.quiet)
     {
       if(p->clumpsout==p->objectsout)
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index d9f3c6a..80b6c83 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -1503,6 +1503,12 @@ ui_read_check_inputs_setup(int argc, char *argv[], 
struct mkcatalogparams *p)
   ui_preparations(p);
 
 
+  /* If the output is a FITS table, prepare all the options as FITS
+     keywords to write in output later. */
+  if(gal_fits_name_is_fits(p->objectsout))
+      gal_options_as_fits_keywords(&p->cp);
+
+
   /* Inform the user. */
   if(!p->cp.quiet)
     {
diff --git a/bin/mknoise/mknoise.c b/bin/mknoise/mknoise.c
index 4c1058a..9abbfe1 100644
--- a/bin/mknoise/mknoise.c
+++ b/bin/mknoise/mknoise.c
@@ -61,7 +61,7 @@ convertsaveoutput(struct mknoiseparams *p)
 
 
   /* Add the proper information to the header of the output: */
-  gal_fits_key_write_filename("INF", p->inputname, &headers);
+  gal_fits_key_write_filename("INF", p->inputname, &headers, 0);
   if( !isnan(p->background_mag) )
     {
       strcpy(keyname1, "BCKGRND");
@@ -97,7 +97,14 @@ convertsaveoutput(struct mknoiseparams *p)
 
   /* Save the output: */
   p->input=gal_data_copy_to_new_type_free(p->input, p->cp.type);
+  p->input->name="NOISED";
   gal_fits_img_write(p->input, p->cp.output, headers, PROGRAM_NAME);
+  p->input->name=NULL;
+
+  /* Write the configuration keywords. */
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "MakeNoise configuration",
+                            "MKNOISE-CONFIG", p->cp.output, "0");
 }
 
 
diff --git a/bin/mknoise/ui.c b/bin/mknoise/ui.c
index f713784..301d3f6 100644
--- a/bin/mknoise/ui.c
+++ b/bin/mknoise/ui.c
@@ -385,6 +385,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
mknoiseparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/mkprof/args.h b/bin/mkprof/args.h
index 72a7b76..b85fac7 100644
--- a/bin/mkprof/args.h
+++ b/bin/mkprof/args.h
@@ -89,8 +89,8 @@ struct argp_option program_options[] =
 
 
     {
-      "naxis",
-      UI_KEY_NAXIS,
+      "mergedsize",
+      UI_KEY_MERGEDSIZE,
       "INT[,INT,...]",
       0,
       "Merged image size along each dimension.",
diff --git a/bin/mkprof/astmkprof.conf b/bin/mkprof/astmkprof.conf
index bd727ce..b680412 100644
--- a/bin/mkprof/astmkprof.conf
+++ b/bin/mkprof/astmkprof.conf
@@ -21,7 +21,7 @@
  backhdu                   1
 
 # Output:
- naxis             1000,1000
+ mergedsize        1000,1000
  oversample                5
  circumwidth               2
  type                float32
diff --git a/bin/mkprof/mkprof.c b/bin/mkprof/mkprof.c
index 22463f0..11ad846 100644
--- a/bin/mkprof/mkprof.c
+++ b/bin/mkprof/mkprof.c
@@ -578,6 +578,11 @@ mkprof_write(struct mkprofparams *p)
       /* Clean up */
       gal_data_free(out);
 
+      /* Write the configuration keywords. */
+      gal_fits_key_write_filename("input", p->catname, &p->cp.okeys, 1);
+      gal_fits_key_write_config(&p->cp.okeys, "MakeProfiles configuration",
+                                "MKPROF-CONFIG", p->mergedimgname, "0");
+
       /* In verbose mode, print the information. */
       if(!p->cp.quiet)
         {
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 5c10474..27291fb 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -487,13 +487,13 @@ ui_read_check_only_options(struct mkprofparams *p)
           "a magnitude, not brightness).");
 
 
-  /* Make sure no zero value is given for the `--naxis' option (only when
-     it is necessary). */
+  /* Make sure no zero value is given for the `--mergedsize' option (only
+     when it is necessary). */
   if(p->dsize && p->backname==NULL)
     for(i=0;p->dsize[i]!=GAL_BLANK_SIZE_T;++i)
       if(p->dsize[i]==0)
-        error(EXIT_FAILURE, 0, "values to `--naxes' option must not be "
-              "zero");
+        error(EXIT_FAILURE, 0, "values to `--mergedsize' option must not "
+              "be zero");
 }
 
 
@@ -1085,7 +1085,7 @@ ui_prepare_canvas(struct mkprofparams *p)
 
       /* Currently, things are only implemented for 2D. */
       if(p->ndim!=2)
-        error(EXIT_FAILURE, 0, "%zu numbers given to `--naxis', only 2 "
+        error(EXIT_FAILURE, 0, "%zu numbers given to `--mergedsize', only 2 "
               "values may be given", p->ndim);
 
       /* If any of the shift elements are zero, the others should be too!*/
@@ -1501,6 +1501,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], 
struct mkprofparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/mkprof/ui.h b/bin/mkprof/ui.h
index 49aba0f..f526b70 100644
--- a/bin/mkprof/ui.h
+++ b/bin/mkprof/ui.h
@@ -54,7 +54,7 @@ enum option_keys_enum
   /* With short-option version. */
   UI_KEY_BACKGROUND      = 'k',
   UI_KEY_BACKHDU         = 'B',
-  UI_KEY_NAXIS           = 'x',
+  UI_KEY_MERGEDSIZE      = 'x',
   UI_KEY_CLEARCANVAS     = 'C',
   UI_KEY_KERNEL          = 'E',
   UI_KEY_OVERSAMPLE      = 's',
diff --git a/bin/noisechisel/noisechisel.c b/bin/noisechisel/noisechisel.c
index a6d1e14..593552e 100644
--- a/bin/noisechisel/noisechisel.c
+++ b/bin/noisechisel/noisechisel.c
@@ -136,144 +136,6 @@ noisechisel_convolve(struct noisechiselparams *p)
 /***********************************************************************/
 /*************                   Output                  ***************/
 /***********************************************************************/
-static void
-noisechisel_params_in_keywords(struct noisechiselparams *p)
-{
-  gal_fits_list_key_t *keys=NULL;
-  struct gal_tile_two_layer_params *tl=&p->cp.tl, *ltl=&p->ltl;
-
-  /* Define the Keywords to write, in the same order as `main.h'. */
-  gal_fits_key_write_filename("input", p->inputname, &keys);
-  gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "hdu", 0, p->cp.hdu,
-                        0, "Extension name or number of input data.", 0,
-                        NULL);
-  if(p->kernelname)
-    {
-      gal_fits_key_write_filename("kernel", p->kernelname, &keys);
-      if(p->khdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "khdu", 0, p->khdu,
-                              0, "HDU/extension of kernel.", 0, NULL);
-    }
-  if(p->convolvedname)
-    {
-      gal_fits_key_write_filename("convolved", p->convolvedname, &keys);
-      if(p->chdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "chdu", 0, p->chdu,
-                              0, "HDU of convolved input.", 0, NULL);
-    }
-  if(p->widekernelname)
-    {
-      gal_fits_key_write_filename("widekernel", p->widekernelname, &keys);
-      if(p->whdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "whdu", 0, p->whdu,
-                              0, "HDU of wide kernel.", 0, NULL);
-    }
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "tilesize_d1", 0,
-                        &tl->tilesize[0], 0,
-                        "Regular tile size on dim.1 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "tilesize_d2", 0,
-                        &tl->tilesize[1], 0,
-                        "Regular tile size on dim.2 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "largetilesize_d1", 0,
-                        &ltl->tilesize[0], 0,
-                        "Regular large tile size on dim.1 (FITS order).",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "largetilesize_d2", 0,
-                        &ltl->tilesize[1], 0,
-                        "Regular large tile size on dim.2 (FITS order).",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "numchannels_d1", 0,
-                        &tl->numchannels[0], 0,
-                        "No. of channels in dim.1 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "numchannels_d2", 0,
-                        &tl->numchannels[1], 0,
-                        "No. of channels in dim.2 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "remainderfrac", 0,
-                        &tl->remainderfrac, 0,
-                        "Fraction of remainder to split last tile.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "workoverch", 0,
-                        &tl->workoverch, 0,
-                        "Work (not tile) over channel edges.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "interponlyblank", 0,
-                        &p->cp.interponlyblank, 0,
-                        "Only interpolate over the blank tiles.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "interpnumngb", 0,
-                        &p->cp.interpnumngb, 0,
-                        "No. of neighbors to use for interpolation.",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "mirrordist", 0,
-                        &p->mirrordist, 0,
-                        "Max. dist. (error multip.) to find mode.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "modmedqdiff", 0,
-                        &p->modmedqdiff, 0,
-                        "Max. mode and median quant diff. per tile.",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "qthresh", 0,
-                        &p->qthresh, 0,
-                        "Quantile threshold on convolved image.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "qthreshtilequant", 0,
-                        &p->qthreshtilequant, 0,
-                        "Remove tiles at higher quantiles.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "smoothwidth", 0,
-                        &p->smoothwidth, 0,
-                        "Flat kernel width to smooth interpolated.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "erode", 0,
-                        &p->erode, 0,
-                        "Number of erosions after thresholding.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "erodengb", 0,
-                        &p->erodengb, 0,
-                        "4 or 8 connectivity in erosion.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "noerodequant", 0,
-                        &p->noerodequant, 0,
-                        "Quantile for no erosion.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "opening", 0,
-                        &p->opening, 0,
-                        "Depth of opening after erosion.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "openingngb", 0,
-                        &p->openingngb, 0,
-                        "4 or 8 connectivity in opening.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT64, "sigmaclipmultip", 0,
-                        &p->sigmaclip[0], 0,
-                        "Multiple of sigma for sigma-clipping.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT64, "sigmaclipend", 0,
-                        &p->sigmaclip[1], 0,
-                        "Termination criteria for sigma-clipping", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "minskyfrac", 0,
-                        &p->minskyfrac, 0,
-                        "Min. fraction of undetected area in tile.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "dthresh", 0,
-                        &p->dthresh, 0,
-                        "Sigma threshold for Pseudo-detections.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "snminarea", 0,
-                        &p->snminarea, 0,
-                        "Min. pseudo-detection area for S/N dist.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "minnumfalse", 0,
-                        &p->minnumfalse, 0,
-                        "Minimum number for S/N estimation.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "snquant", 0,
-                        &p->snquant, 0,
-                        "Quantile in pseudo-det. to define true.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "detgrowquant", 0,
-                        &p->detgrowquant, 0,
-                        "Minimum quant. to expand true detections.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "detgrowmaxholesize", 0,
-                        &p->detgrowmaxholesize, 0,
-                        "Max. area of holes after growth to fill.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "cleangrowndet", 0,
-                        &p->cleangrowndet, 0,
-                        "Remove small S/N grown detections.", 0, NULL);
-
-  /* Reverse the list and write the keywords into the zero-th HDU. */
-  gal_fits_key_list_reverse(&keys);
-  gal_fits_key_write_version(&keys, "NoiseChisel configuration",
-                             p->cp.output, "0");
-
-}
-
-
-
-
-
 /* Write the output file. */
 static void
 noisechisel_output(struct noisechiselparams *p)
@@ -340,9 +202,12 @@ noisechisel_output(struct noisechiselparams *p)
                              p->cp.output, keys, PROGRAM_NAME);
   p->std->name=NULL;
 
-  /* Write NoiseChisel's parameters as keywords into the first extension of
-     the output. */
-  noisechisel_params_in_keywords(p);
+
+  /* Write the configuration keywords. */
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "NoiseChisel configuration",
+                            "NOISECHISEL-CONFIG", p->cp.output, "0");
+
 
   /* Let the user know that the output is written. */
   if(!p->cp.quiet)
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index 9b36430..42a7d6c 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -675,6 +675,10 @@ ui_read_check_inputs_setup(int argc, char *argv[],
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/segment/segment.c b/bin/segment/segment.c
index a8bee88..c184e6f 100644
--- a/bin/segment/segment.c
+++ b/bin/segment/segment.c
@@ -1048,132 +1048,6 @@ segment_detections(struct segmentparams *p)
 /***********************************************************************/
 /*****************                Output               *****************/
 /***********************************************************************/
-static void
-segment_params_in_keywords(struct segmentparams *p)
-{
-  gal_fits_list_key_t *keys=NULL;
-  struct gal_tile_two_layer_params *tl=&p->cp.tl, *ltl=&p->ltl;
-
-  /* Define the Keywords to write, in the same order as `main.h'. */
-  gal_fits_key_write_filename("input", p->inputname, &keys);
-  gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "hdu", 0, p->cp.hdu,
-                        0, "Extension name or number of input data.", 0,
-                        NULL);
-  if(p->skyname)
-    {
-      gal_fits_key_write_filename("sky", p->skyname, &keys);
-      if(p->skyhdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "skyhdu", 0, p->skyhdu,
-                              0, "HDU containing Sky value to subtract.", 0,
-                              NULL);
-    }
-  if(p->stdname)
-    {
-      gal_fits_key_write_filename("std", p->stdname, &keys);
-      if(p->stdhdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "stdhdu", 0, p->stdhdu,
-                              0, "HDU containing Sky standard deviation.", 0,
-                              NULL);
-    }
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "variance", 0,
-                        &p->variance, 0,
-                        "STD input is actually variance.", 0, NULL);
-  if(p->detectionname)
-    {
-      gal_fits_key_write_filename("detection", p->detectionname, &keys);
-      if(p->khdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "dhdu", 0, p->dhdu,
-                              0, "HDU containing detection image.", 0, NULL);
-    }
-  if(p->kernelname)
-    {
-      gal_fits_key_write_filename("kernel", p->kernelname, &keys);
-      if(p->khdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "khdu", 0, p->khdu,
-                              0, "HDU/extension of kernel.", 0, NULL);
-    }
-  if(p->convolvedname)
-    {
-      gal_fits_key_write_filename("convolved", p->convolvedname, &keys);
-      if(p->chdu)
-        gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "chdu", 0, p->chdu,
-                              0, "HDU of convolved input.", 0, NULL);
-    }
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "onlyclumps", 0,
-                        &p->onlyclumps, 0,
-                        "Finish after finding true clumps.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "grownclumps", 0,
-                        &p->grownclumps, 0,
-                        "Save grown clumps instead of original.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "tilesize_d1", 0,
-                        &tl->tilesize[0], 0,
-                        "Regular tile size on dim.1 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "tilesize_d2", 0,
-                        &tl->tilesize[1], 0,
-                        "Regular tile size on dim.2 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "largetilesize_d1", 0,
-                        &ltl->tilesize[0], 0,
-                        "Regular large tile size on dim.1 (FITS order).",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "largetilesize_d2", 0,
-                        &ltl->tilesize[1], 0,
-                        "Regular large tile size on dim.2 (FITS order).",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "numchannels_d1", 0,
-                        &tl->numchannels[0], 0,
-                        "No. of channels in dim.1 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "numchannels_d2", 0,
-                        &tl->numchannels[1], 0,
-                        "No. of channels in dim.2 (FITS order).", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "minskyfrac", 0,
-                        &p->minskyfrac, 0,
-                        "Min. fraction of undetected area in tile.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "minima", 0,
-                        &p->minima, 0,
-                        "Built internal clumps from minima.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "snminarea", 0,
-                        &p->snminarea, 0,
-                        "Minimum area of clumps for S/N estimation.",
-                        0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "minnumfalse", 0,
-                        &p->minnumfalse, 0,
-                        "Minimum number for S/N estimation.", 0, NULL);
-  if( !isnan(p->snquant) )
-    gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "snquant", 0,
-                          &p->snquant, 0,
-                          "S/N Quantile of true sky clumps.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "keepmaxnearriver", 0,
-                        &p->keepmaxnearriver, 0,
-                        "Keep clumps with peak touching a river.", 0, NULL);
-  if( isnan(p->snquant) )
-    gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "clumpsnthresh", 0,
-                          &p->clumpsnthresh, 0,
-                          "S/N threshold of true clumps.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "gthresh", 0,
-                        &p->gthresh, 0,
-                        "Multiple of STD to stop growing clumps.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "minriverlength", 0,
-                        &p->minriverlength, 0,
-                        "Minimum len of useful grown clump rivers.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "objbordersn", 0,
-                        &p->objbordersn, 0,
-                        "Min. S/N for grown clumps as one object.", 0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_UINT8, "checksegmentation", 0,
-                        &p->checksegmentation, 0,
-                        "Store segmentation steps in a file.", 0, NULL);
-
-
-  /* Reverse the list and write the keywords into the zero-th HDU. */
-  gal_fits_key_list_reverse(&keys);
-  gal_fits_key_write_version(&keys, "Segment configuration",
-                             p->cp.output, "0");
-
-}
-
-
-
-
-
 void
 segment_output(struct segmentparams *p)
 {
@@ -1247,9 +1121,10 @@ segment_output(struct segmentparams *p)
       p->std->name=NULL;
     }
 
-  /* Write the input parameters as FITS keyword in the first extension of
-     the output file. */
-  segment_params_in_keywords(p);
+  /* Write the configuration keywords. */
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "Segment configuration",
+                            "SEGMENT-CONFIG", p->cp.output, "0");
 
   /* Let the user know that the output is written. */
   if(!p->cp.quiet)
@@ -1358,7 +1233,7 @@ segment(struct segmentparams *p)
 
 
   /* If the user wanted to check the segmentation and hasn't called
-     `continueaftercheck', then stop NoiseChisel. */
+     `continueaftercheck', then stop Segment. */
   if(p->segmentationname && !p->continueaftercheck)
     ui_abort_after_check(p, p->segmentationname, NULL,
                          "showing all segmentation steps");
diff --git a/bin/segment/ui.c b/bin/segment/ui.c
index 168f8e7..3c3f637 100644
--- a/bin/segment/ui.c
+++ b/bin/segment/ui.c
@@ -881,6 +881,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
segmentparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/statistics/sky.c b/bin/statistics/sky.c
index 8b5bc62..8ab6a36 100644
--- a/bin/statistics/sky.c
+++ b/bin/statistics/sky.c
@@ -265,6 +265,9 @@ sky(struct statisticsparams *p)
   gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankinsky, outname,
                              NULL, PROGRAM_NAME);
   p->sky_t->name = p->std_t->name = NULL;
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "Statistics configuration",
+                            "STATISTICS-CONFIG", outname, "0");
   if(!cp->quiet)
     printf("  - Written to `%s'.\n", outname);
 
diff --git a/bin/statistics/statistics.c b/bin/statistics/statistics.c
index 5cd1c63..e9ad1e5 100644
--- a/bin/statistics/statistics.c
+++ b/bin/statistics/statistics.c
@@ -255,6 +255,9 @@ statistics_interpolate_and_write(struct statisticsparams *p,
 
   /* Write the values. */
   gal_tile_full_values_write(values, &cp->tl, 1, output, NULL, PROGRAM_NAME);
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "Statistics configuration",
+                            "STATISTICS-CONFIG", output, "0");
 }
 
 
@@ -591,6 +594,12 @@ write_output_table(struct statisticsparams *p, gal_data_t 
*table,
   gal_table_write(table, comments, p->cp.tableformat, output, "TABLE", 0);
 
 
+  /* Write the configuration information. */
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "Statistics configuration",
+                            "STATISTICS-CONFIG", output, "0");
+
+
   /* Let the user know, if we aren't in quiet mode. */
   if(!p->cp.quiet)
     printf("%s created.\n", output);
diff --git a/bin/statistics/ui.c b/bin/statistics/ui.c
index 03242f9..e9f3f31 100644
--- a/bin/statistics/ui.c
+++ b/bin/statistics/ui.c
@@ -949,6 +949,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
statisticsparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/warp/ui.c b/bin/warp/ui.c
index a2e83c3..8c79754 100644
--- a/bin/warp/ui.c
+++ b/bin/warp/ui.c
@@ -929,6 +929,10 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
warpparams *p)
   gal_options_print_state(&p->cp);
 
 
+  /* Prepare all the options as FITS keywords to write in output later. */
+  gal_options_as_fits_keywords(&p->cp);
+
+
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
diff --git a/bin/warp/warp.c b/bin/warp/warp.c
index 7065ec6..14e15f8 100644
--- a/bin/warp/warp.c
+++ b/bin/warp/warp.c
@@ -460,7 +460,7 @@ correct_wcs_save_output(struct warpparams *p)
     }
 
   /* Add the appropriate headers: */
-  gal_fits_key_write_filename("INF", p->inputname, &headers);
+  gal_fits_key_write_filename("INF", p->inputname, &headers, 0);
   for(i=0;i<9;++i)
     {
       sprintf(&keyword[i*FLEN_KEYWORD], "WMTX%zu_%zu", i/3+1, i%3+1);
@@ -473,6 +473,11 @@ correct_wcs_save_output(struct warpparams *p)
   if(p->cp.type!=p->output->type)
     p->output=gal_data_copy_to_new_type_free(p->output, p->cp.type);
   gal_fits_img_write(p->output, p->cp.output, headers, PROGRAM_NAME);
+
+  /* Write the configuration keywords. */
+  gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
+  gal_fits_key_write_config(&p->cp.okeys, "Warp configuration",
+                            "WARP-CONFIG", p->cp.output, "0");
 }
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index d8a8d60..f80393a 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -297,7 +297,7 @@ Common program behavior
 * Tessellation::                Tile the dataset into non-overlapping bins.
 * Getting help::                Getting more information on the go.
 * Automatic output::            About automatic output names.
-* Output headers::              Common headers to all FITS outputs.
+* Output FITS files::           Common properties when outputs are FITS.
 
 Command-line
 
@@ -1936,7 +1936,7 @@ $ astmkprof -P
 
 # Output:
  type         float32     # Type of output: e.g., int16, float32, etc...
- naxis        1000,1000   # Number of pixels along first FITS axis.
+ mergedsize   1000,1000   # Number of pixels along first FITS axis.
  oversample   5           # Scale of oversampling (>0 and odd).
 
 [[[ ... Truncated lines ... ]]]
@@ -2019,7 +2019,7 @@ necessary parameters and runs MakeProfiles with the 
following command:
 
 @example
 
-$ astmkprof --prepforconv --naxis=500,500 --zeropoint=18.0 cat.txt
+$ astmkprof --prepforconv --mergedsize=500,500 --zeropoint=18.0 cat.txt
 MakeProfiles started on Sat Oct  6 16:26:56 953
   - 6 profiles read from cat.txt
   - Random number generator (RNG) type: mt19937
@@ -2184,7 +2184,8 @@ base=cat
 rm out.fits
 
 # Run MakeProfiles to create an oversampled FITS image.
-astmkprof --prepforconv --naxis=500,500 --zeropoint=18.0 "$base".txt
+astmkprof --prepforconv --mergedsize=500,500 --zeropoint=18.0   \
+          "$base".txt
 
 # Convolve the created image with the kernel.
 astconvolve --kernel=0_"$base".fits "$base".fits
@@ -4890,7 +4891,7 @@ controlled source}). When @file{libgit2} is present, and 
Gnuastro's
 programs are run within a version controlled directory, outputs will
 contain the version number of the working directory's repository for future
 reproducibility. See the @command{COMMIT} keyword header in @ref{Output
-headers} for a discussion.
+FITS files} for a discussion.
 
 @item libjpeg
 @pindex libjpeg
@@ -6832,7 +6833,7 @@ command-line.
 * Tessellation::                Tile the dataset into non-overlapping bins.
 * Getting help::                Getting more information on the go.
 * Automatic output::            About automatic output names.
-* Output headers::              Common headers to all FITS outputs.
+* Output FITS files::           Common properties when outputs are FITS.
 @end menu
 
 @node Command-line, Configuration files, Common program behavior, Common 
program behavior
@@ -9050,7 +9051,7 @@ list. We have other mailing lists and tools for those 
purposes, see
 
 
 
address@hidden Automatic output, Output headers, Getting help, Common program 
behavior
address@hidden Automatic output, Output FITS files, Getting help, Common 
program behavior
 @section Automatic output
 
 @cindex Automatic output file names
@@ -9105,15 +9106,57 @@ ABC01.jpg ABC02.jpg DEF01_detected.fits
 
 
 
address@hidden Output headers,  , Automatic output, Common program behavior
address@hidden Output headers
address@hidden Output FITS files,  , Automatic output, Common program behavior
address@hidden Output FITS files
 
address@hidden FITS
 @cindex Output FITS headers
 @cindex CFITSIO version on outputs
-The output FITS files created by Gnuastro's programs have some or all of
-the following standard keywords to keep the basic date and version
-information of Gnuastro, its dependencies and the pipeline that is using
-Gnuastro.
+The output of many of Gnuastro's programs are (or can be) FITS files. The
+FITS format has many useful features for storing scientific datasets
+(cubes, images and tables) along with a robust features for
+archivability. For more on this standard, please see @ref{Fits}.
+
+As a community convention described in @ref{Fits}, the first extension of
+all FITS files produced by Gnuastro's programs only contains the meta-data
+that is intended for the file's extension(s). For a Gnuastro program, this
+generic meta-data (that is stored as FITS keyword records) is its
+configuration when it produced this dataset: file name(s) of input(s) and
+option names, values and comments. Note that when the configuration is too
+trivial (only input filename, for example the program @ref{Table}) no
+meta-data is written in this extension.
+
+FITS keywords have the following limitations in regards to generic option
+names and values which are described below:
+
address@hidden
address@hidden
+If a keyword (option name) is longer than 8 characters, the first word in
+the record (80 character line) is @code{HIERARCH} which is followed by the
+keyword name.
+
address@hidden
+Values can be at most 75 characters, but for strings, this changes to 73
+(because of the two extra @key{'} characters that are necessary). However,
+if the value is a file name, containing slash (@key{/}) characters to
+separate directories, Gnuastro will break the value into multiple keywords.
+
address@hidden
+Keyword names ignore case, therefore they are all in capital letters.
+Therefore, if you want to use Grep to inspect these keywords, use the
address@hidden option, like the example below.
+
address@hidden
+$ astfits image_detected.fits -h0 | grep -i snquant
address@hidden example
address@hidden itemize
+
+The keywords above are classified (separated by an empty line and title) as
+a group titled ``ProgramName configuration''. This meta-data extension, as
+well as all the other extensions (which contain data), also contain have
+final group of keywords to keep the basic date and version information of
+Gnuastro, its dependencies and the pipeline that is using Gnuastro (if its
+under version control).
 
 @table @command
 
@@ -9193,10 +9236,10 @@ Here is one example of the last few lines of an example 
output.
               / Versions and date
 DATE    = '...'                / file creation date
 COMMIT  = 'v0-8-g547f6eb'      / Commit description in running dir.
-CFITSIO = '3.41    '           / CFITSIO version.
-WCSLIB  = '5.16    '           / WCSLIB version.
-GSL     = '2.3     '           / GNU Scientific Library version.
-GNUASTRO= '0.3'                / GNU Astronomy Utilities version.
+CFITSIO = '3.45    '           / CFITSIO version.
+WCSLIB  = '5.19    '           / WCSLIB version.
+GSL     = '2.5     '           / GNU Scientific Library version.
+GNUASTRO= '0.7     '           / GNU Astronomy Utilities version.
 END
 @end example
 
@@ -9293,19 +9336,20 @@ webpage} for the full text of all versions. Also see the
 for a nice introduction and history along with the full standard.
 
 @cindex Meta-data
-Other formats, for example a JPEG image, only have one image/dataset per
-file, however one great advantage of the FITS standard is that it allows
-you to keep multiple datasets (images or tables along with their meta-data)
-in one file. Each data + metadata is known as an extension, or more
-formally a header data unit or HDU, in the FITS standard. In theory the
-HDUs can be completely independent: you can have multiple images of
-different dimensions/sizes or tables as separate extensions in one
+Many common image formats, for example a JPEG, only have one image/dataset
+per file, however one great advantage of the FITS standard is that it
+allows you to keep multiple datasets (images or tables along with their
+separate meta-data) in one file. In the FITS standard, each data + metadata
+is known as an extension, or more formally a header data unit or HDU. The
+HDUs in a file can be completely independent: you can have multiple images
+of different dimensions/sizes or tables as separate extensions in one
 file. However, while the standard doesn't impose any constraints on the
 relation between the datasets, it is strongly encouraged to group data that
 are contextually related with each other in one file. For example an image
 and the table/catalog of objects and their measured properties in that
-image. Another example can be multiple images of one patch of sky in
-different colors (filters).
+image. Other examples can be images of one patch of sky in different colors
+(filters), or one raw telescope image along with its calibration data
+(tables or images).
 
 As discussed above, the extensions in a FITS file can be completely
 independent. To keep some information (meta-data) about the group of
@@ -9314,15 +9358,16 @@ convention: put no data in the first extension, so it 
is just
 meta-data. This extension can thus be used to store Meta-data regarding the
 whole file (grouping of extensions). Subsequent extensions may contain data
 along with their own separate meta-data. All of Gnuastro's programs also
-follow this convention: the main dataset (image or table) is in the second
-extension. See the example list of extension properties in @ref{Invoking
-astfits}.
+follow this convention: the main output dataset(s) are placed in the second
+(or later) extension(s). The first extension contains no data the program's
+configuration (input file name, along with all its option values) are
+stored as its meta-data, see @ref{Output FITS files}.
 
 The meta-data contain information about the data, for example which region
 of the sky an image corresponds to, the units of the data, what telescope,
-camera, and filter the data were taken with, the software that produced it,
-or it observation or processing date. Hence without the meta-data, the raw
-dataset is practically just a collection of numbers and really hard to
+camera, and filter the data were taken with, it observation date, or the
+software that produced it and its configuration. Without the meta-data, the
+raw dataset is practically just a collection of numbers and really hard to
 understand, or connect with the real world (other datasets). It is thus
 strongly encouraged to supplement your data (at any level of processing)
 with as much meta-data about your processing/science as possible.
@@ -16067,7 +16112,9 @@ detection map is followed by a Sky and Sky standard 
deviation dataset
 (which are calculated from the binary image). By default (when
 @option{--rawoutput} isn't called), NoiseChisel will also subtract the Sky
 value from the input and save the sky-subtracted input as the first
-extension in the output.
+extension in the output with data. The zero-th extension (that contains no
+data), contains NoiseChisel's configuration as FITS keywords, see
address@hidden FITS files}.
 
 The name of the output file can be set by giving a value to
 @option{--output} (this is a common option between all programs and is
@@ -16080,19 +16127,6 @@ the different check images, see the description for 
the @option{--check*}
 options in @ref{Detection options} (this can be disabled with
 @option{--continueaftercheck}).
 
-Similar to all Gnuastro's FITS outputs, the zero-th extension/HDU of the
-main output file only contains header keywords and image or table. It
-contains the NoiseChisel input files and parameters (option names and
-values) as FITS keywords. Note that if an option name is longer than 8
-characters, the keyword name is the second word. The first word is
address@hidden Also note that according to the FITS standard, the keyword
-names must be in capital letters, therefore, if you want to use Grep to
-inspect these keywords, use the @option{-i} option, like the example below.
-
address@hidden
-$ astfits image_detected.fits -h0 | grep -i snquant
address@hidden example
-
 The last two extensions of the output are the Sky and its Standard
 deviation, see @ref{Sky value} for a complete explanation. They are
 calculated on the tile grid that you defined for NoiseChisel. By default
@@ -19362,7 +19396,7 @@ $ astmkprof --ccol=RA_CENTER --ccol=DEC_CENTER 
--mode=wcs catalog.txt
 
 ## Make a 1500x1500 merged image (oversampled 500x500) image along
 ## with an individual image for all the profiles in catalog:
-$ astmkprof --individual --oversample 3 --naxis=500,500 catalog.txt
+$ astmkprof --individual --oversample 3 --mergedsize=500,500 cat.txt
 @end example
 
 @noindent
@@ -19388,8 +19422,8 @@ that image are used as the background value for every 
pixel. The flux value
 of each profile pixel will be added to the pixel in that background
 value. In this case, the values to all options relating to the output size
 and WCS will be ignored if specified (for example @option{--oversample},
address@hidden, and @option{--prepforconv}) on the command-line or in the
-configuration files.
address@hidden, and @option{--prepforconv}) on the command-line or
+in the configuration files.
 
 The sections below discuss the options specific to MakeProfiles based on
 context: the input catalog settings which can have many rows for different
@@ -19743,9 +19777,10 @@ A background image FITS file to build the profiles on. 
The extension that
 contains the image should be specified with the @option{--backhdu} option,
 see below. When a background image is specified, it will be used to derive
 all the information about the output image. Hence, the following options
-will be ignored: @option{--naxis}, @option{--oversample}, @option{--crpix},
address@hidden (generally, all other WCS related parameters) and the
-output's data type (see @option{--type} in @ref{Input output options}).
+will be ignored: @option{--mergedsize}, @option{--oversample},
address@hidden, @option{--crval} (generally, all other WCS related
+parameters) and the output's data type (see @option{--type} in @ref{Input
+output options}).
 
 The image will act like a canvas to build the profiles on: profile pixel
 values will be summed with the background image pixel values. With the
@@ -19810,14 +19845,15 @@ A Gaussian kernel with FWHM of 2 pixels and truncated 
at 3 times the FWHM.
 @end table
 
 @item -x INT,INT
address@hidden --naxis=INT,INT
-The number of pixels along each dimension axis of the output in FITS
-order. This is before over-sampling. For example if you call MakeProfiles
-with @option{--naxis=100,150 --oversample=5} (assuming no shift due for
address@hidden --mergedsize=INT,INT
+The number of pixels along each axis of the output, in FITS order. This is
+before over-sampling. For example if you call MakeProfiles with
address@hidden,150 --oversample=5} (assuming no shift due for
 later convolution), then the final image size along the first axis will be
 500 by 750 pixels. Fractions are acceptable as values for each dimension,
-however, they must reduce to an integer, so @option{--naxis=150/3,300/3} is
-acceptable but @option{--naxis=150/4,300/4} is not.
+however, they must reduce to an integer, so
address@hidden/3,300/3} is acceptable but
address@hidden/4,300/4} is not.
 
 When viewing a FITS image in DS9, the first FITS dimension is in the
 horizontal direction and the second is vertical. As an example, the image
@@ -19875,8 +19911,8 @@ number position: The center of a pixel has fractional 
value
 @item -m
 @itemx --nomerged
 Don't make a merged image. By default after making the profiles, they are
-added to a final image with side lengths specified by @option{--naxis}if
-they overlap with it.
+added to a final image with side lengths specified by @option{--mergedsize}
+if they overlap with it.
 
 @end table
 
@@ -24339,7 +24375,7 @@ information includes the following information
 @item
 If the program is run in a Git version controlled directory, Git's
 description is printed (see description under @code{COMMIT} in @ref{Output
-headers}).
+FITS files}).
 @item
 The calendar time that is stored in @code{rawtime} (@code{time_t} is C's
 calendar time format defined in @file{time.h}). You can calculate the time
@@ -24761,11 +24797,12 @@ classifying the keywords into groups and inspecting 
them by eye. If
 @code{title==NULL}, this function won't do anything.
 @end deftypefun
 
address@hidden void gal_fits_key_write_filename (char @code{*keynamebase}, char 
@code{*filename}, gal_fits_list_key_t @code{**list})
address@hidden void gal_fits_key_write_filename (char @code{*keynamebase}, char 
@code{*filename}, gal_fits_list_key_t @code{**list}, int @code{top1end0})
 Put @file{filename} into the @code{gal_fits_list_key_t} list (possibly
 broken up into multiple keywords) to later write into a HDU header. The
 @code{keynamebase} string will be appended with a @code{_N} (N>0) and used
-as the keyword name.
+as the keyword name. If @code{top1end0!=0}, then the keywords containing
+the filename will be added to the top of the list.
 
 The FITS standard sets a maximum length for the value of a keyword. This
 creates problems with file names (which include directories). Because file
@@ -24805,7 +24842,7 @@ Write or update (all the) keyword(s) in @code{headers} 
into the FITS
 pointer, but also the date, name of your program (@code{program_name}),
 along with the versions of CFITSIO, WCSLIB (when available), GSL, Gnuastro,
 and (the possible) commit information into the header as described in
address@hidden headers}.
address@hidden FITS files}.
 
 Since the data processing depends on the versions of the libraries you have
 used, it is strongly recommended to include this information in every FITS
@@ -24813,6 +24850,22 @@ output. @code{gal_fits_img_write} and 
@code{gal_fits_tab_write} will
 automatically use this function.
 @end deftypefun
 
address@hidden void gal_fits_key_write_config (gal_fits_list_key_t 
@code{**keylist}, char @code{*title}, char @code{*extname}, char 
@code{*filename}, char @code{*hdu})
+Write the given keyword list (@code{keylist}) into the @code{hdu} extension
+of @code{filename}, ending it with version information. This function will
+write @code{extname} as the name of the extension (value to the standard
address@hidden FITS keyword). The list of keywords will then be printed
+under a title called @code{title}.
+
+This function is used by many Gnuastro programs and is primarily intended
+for writing configuration settings of a program into the zero-th extension
+of their FITS outputs (which is empty when the FITS file is created by
+Gnuastro's program and this library).
address@hidden deftypefun
+
+
+
+
 
 @node FITS arrays, FITS tables, FITS header keywords, FITS files
 @subsubsection FITS arrays (images)
@@ -27841,7 +27894,7 @@ blank. To see if any blank (non-interpolated) elements 
remain, you can use
 @cindex libgit2
 Git is one of the most common tools for version control and it can often be
 useful during development, for example see @code{COMMIT} keyword in
address@hidden headers}. At installation time, Gnuastro will also check for
address@hidden FITS files}. At installation time, Gnuastro will also check for
 the existence of libgit2, and store the value in the
 @code{GAL_CONFIG_HAVE_LIBGIT2}, see @ref{Configuration information} and
 @ref{Optional dependencies}. @file{gnuastro/git.h} includes
@@ -27856,8 +27909,8 @@ commit description (similar to Gnuastro's unofficial 
version number, see
 directory, it will add a address@hidden' prefix to the description. When
 there is no tagged point in the previous commit, this function will return
 a uniquely abbreviated commit object as fallback. This function is used for
-generating the value of the @code{COMMIT} keyword in @ref{Output
-headers}. The output string is similar to the output of the following
+generating the value of the @code{COMMIT} keyword in @ref{Output FITS
+files}. The output string is similar to the output of the following
 command:
 
 @example
diff --git a/lib/fits.c b/lib/fits.c
index 4a6ffc2..ad6a854 100644
--- a/lib/fits.c
+++ b/lib/fits.c
@@ -1222,7 +1222,7 @@ gal_fits_key_write_title_in_ptr(char *title, fitsfile 
*fptr)
 /* Write a filename into keyword values. */
 void
 gal_fits_key_write_filename(char *keynamebase, char *filename,
-                            gal_fits_list_key_t **list)
+                            gal_fits_list_key_t **list, int top1end0)
 {
   char *keyname, *value;
   size_t numkey=1, maxlength;
@@ -1245,7 +1245,7 @@ gal_fits_key_write_filename(char *keynamebase, char 
*filename,
         error(EXIT_FAILURE, errno, "%s: %d bytes for `keyname'", __func__,
               FLEN_KEYWORD);
       if(len<maxlength)
-        gal_checkset_allocate_copy(keynamebase, &keyname);
+        strcpy(keyname, keynamebase);
       else
         sprintf(keyname, "%s_%zu", keynamebase, numkey++);
 
@@ -1264,8 +1264,12 @@ gal_fits_key_write_filename(char *keynamebase, char 
*filename,
          length was copied. */
       if(value[maxlength-1]=='\0')
         {
-          gal_fits_key_list_add_end(list, GAL_TYPE_STRING, keyname, 1,
-                                    value, 1, NULL, 0, NULL);
+          if(top1end0)
+            gal_fits_key_list_add(list, GAL_TYPE_STRING, keyname, 1,
+                                  value, 1, NULL, 0, NULL);
+          else
+            gal_fits_key_list_add_end(list, GAL_TYPE_STRING, keyname, 1,
+                                      value, 1, NULL, 0, NULL);
           break;
         }
       else
@@ -1280,14 +1284,28 @@ gal_fits_key_write_filename(char *keynamebase, char 
*filename,
                 break;
               }
           if(j==0)
-            error(EXIT_FAILURE, 0, "%s: the filename `%sP has at least one "
-                  "span of %zu characters without a `/`. It cannot be "
-                  "written to the header of the output fits file", __func__,
-                  filename, maxlength);
+            {
+              /* So the loop doesn't continue after this. */
+              i=len+1;
+
+              /* There will only be one keyword, so we'll just use the
+                 basename. */
+              strcpy(keyname, keynamebase);
+
+              /* Let the user know that  */
+              error(0,0, "%s: WARNING: `%s' is too long to fit "
+                    "into a FITS keyword value (max of %zu characters), "
+                    "it will be truncated", __func__, filename,
+                    maxlength);
+            }
 
           /* Convert the last useful character and save the file name.*/
-          gal_fits_key_list_add_end(list, GAL_TYPE_STRING, keyname, 1,
-                                    value, 1, NULL, 0, NULL);
+          if(top1end0)
+            gal_fits_key_list_add(list, GAL_TYPE_STRING, keyname, 1,
+                                  value, 1, NULL, 0, NULL);
+          else
+            gal_fits_key_list_add_end(list, GAL_TYPE_STRING, keyname, 1,
+                                      value, 1, NULL, 0, NULL);
           i+=j+1;
         }
     }
@@ -1485,6 +1503,43 @@ gal_fits_key_write_version_in_ptr(gal_fits_list_key_t 
**keylist, char *title,
 
 
 
+/* Write the given keywords into the given extension of the given file,
+   ending it with version information. This is primarily intended for
+   writing configuration settings of a program into the zero-th extension
+   of the FITS file (which is empty when the FITS file is created by
+   Gnuastro's program and this library). */
+void
+gal_fits_key_write_config(gal_fits_list_key_t **keylist, char *title,
+                          char *extname, char *filename, char *hdu)
+{
+  int status=0;
+  fitsfile *fptr=gal_fits_hdu_open(filename, hdu, READWRITE);
+
+  /* Delete the two extra comment lines describing the FITS standard that
+     CFITSIO puts in when it creates a new extension. We'll set status to 0
+     afterwards so even if they don't exist, the program continues
+     normally. */
+  fits_delete_key(fptr, "COMMENT", &status);
+  fits_delete_key(fptr, "COMMENT", &status);
+  status=0;
+
+  /* Put a name for the zero-th extension. */
+  if(fits_write_key(fptr, TSTRING, "EXTNAME", extname, "", &status))
+    gal_fits_io_error(status, NULL);
+
+  /* Write all the given keywords. */
+  gal_fits_key_write_version_in_ptr(keylist, title, fptr);
+
+  /* Close the FITS file. */
+  if( fits_close_file(fptr, &status) )
+    gal_fits_io_error(status, NULL);
+}
+
+
+
+
+
+
 
 
 
diff --git a/lib/gnuastro-internal/options.h b/lib/gnuastro-internal/options.h
index e2777b7..37641a4 100644
--- a/lib/gnuastro-internal/options.h
+++ b/lib/gnuastro-internal/options.h
@@ -26,6 +26,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include <gnuastro/tile.h>
 #include <gnuastro/list.h>
+#include <gnuastro/fits.h>
 
 
 
@@ -203,6 +204,9 @@ struct gal_options_common_params
   uint8_t           setusrconf; /* To write teh user config config file.  */
   uint8_t           lastconfig; /* This is the last configuration file.   */
 
+  /* Output files. */
+  gal_fits_list_key_t  *okeys;  /* Configuration as FITS keys in output.  */
+
   /* For internal (to option processing) purposes. */
   uint8_t                 keep; /* Output file can exist.                 */
   void         *program_struct; /* Host program's main variable struct.   */
@@ -319,4 +323,7 @@ gal_options_read_config_set(struct 
gal_options_common_params *cp);
 void
 gal_options_print_state(struct gal_options_common_params *cp);
 
+void
+gal_options_as_fits_keywords(struct gal_options_common_params *cp);
+
 #endif
diff --git a/lib/gnuastro/fits.h b/lib/gnuastro/fits.h
index c922c07..c37c6c0 100644
--- a/lib/gnuastro/fits.h
+++ b/lib/gnuastro/fits.h
@@ -192,7 +192,7 @@ gal_fits_key_write_title_in_ptr(char *title, fitsfile 
*fptr);
 
 void
 gal_fits_key_write_filename(char *keynamebase, char *filename,
-                            gal_fits_list_key_t **list);
+                            gal_fits_list_key_t **list, int top1end0);
 
 void
 gal_fits_key_write_wcsstr(fitsfile *fptr, char *wcsstr, int nkeyrec);
@@ -212,6 +212,10 @@ void
 gal_fits_key_write_version_in_ptr(gal_fits_list_key_t **keylist, char *title,
                                   fitsfile *fptr);
 
+void
+gal_fits_key_write_config(gal_fits_list_key_t **keylist, char *title,
+                          char *extname, char *filename, char *hdu);
+
 
 
 
diff --git a/lib/options.c b/lib/options.c
index 668489c..3e8eedc 100644
--- a/lib/options.c
+++ b/lib/options.c
@@ -30,6 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include <gnuastro/git.h>
 #include <gnuastro/txt.h>
+#include <gnuastro/fits.h>
 #include <gnuastro/list.h>
 #include <gnuastro/data.h>
 #include <gnuastro/table.h>
@@ -2195,3 +2196,83 @@ gal_options_print_state(struct gal_options_common_params 
*cp)
             "and `setusrconf' options can be called in each run");
     }
 }
+
+
+
+
+
+/* Main working function for common and program specific options. */
+static void
+options_as_fits_keywords_write(gal_fits_list_key_t **keys,
+                               struct argp_option *options,
+                               struct gal_options_common_params *cp)
+{
+  size_t i;
+  void *vptr;
+  uint8_t vtype;
+  char *name, *doc;
+  gal_list_str_t *tmp;
+
+  for(i=0; !gal_options_is_last(&options[i]); ++i)
+    if( options[i].set && option_is_printable(&options[i]) )
+      {
+        /* Linked lists (multiple calls to an option). */
+        if(gal_type_is_list(options[i].type))
+          for(tmp=*(gal_list_str_t **)(options[i].value);
+              tmp!=NULL; tmp=tmp->next)
+            {
+              /* `name' and `doc' have a `const' qualifier. */
+              gal_checkset_allocate_copy(options[i].name, &name);
+              gal_checkset_allocate_copy(options[i].doc,  &doc);
+              gal_fits_key_list_add(keys, GAL_TYPE_STRING, name, 1, tmp->v,
+                                    0, doc, 1, NULL);
+            }
+        /* Normal types. */
+        else
+          {
+            /* If the option is associated with a special function for
+               reading and writing, we'll need to write the value as a
+               string. */
+            if(options[i].func)
+              {
+                vtype=GAL_TYPE_STRING;
+                vptr=options[i].func(&options[i], NULL, NULL, (size_t)(-1),
+                                      cp->program_struct);
+              }
+            else
+              {
+                vtype=options[i].type;
+                vptr = ( vtype==GAL_TYPE_STRING
+                         ? *((char **)(options[i].value))
+                         : options[i].value );
+              }
+
+            /* Write the keyword. Note that `name' and `doc' have a `const'
+               qualifier. */
+            gal_checkset_allocate_copy(options[i].name, &name);
+            if(vtype==GAL_TYPE_STRING && strlen(vptr)>FLEN_KEYWORD)
+              gal_fits_key_write_filename(name, vptr, keys, 1);
+            else
+              {
+                gal_checkset_allocate_copy(options[i].doc,  &doc);
+                gal_fits_key_list_add(keys, vtype, name, 1, vptr, 0, doc, 1,
+                                      NULL);
+              }
+          }
+      }
+}
+
+
+
+
+/* Write all options as FITS keywords. */
+void
+gal_options_as_fits_keywords(struct gal_options_common_params *cp)
+{
+  /* Write all the command and program-specific options. */
+  options_as_fits_keywords_write(&cp->okeys, cp->coptions, cp);
+  options_as_fits_keywords_write(&cp->okeys, cp->poptions, cp);
+
+  /* Reverse the list (its a first-in-first-out list). */
+  gal_fits_key_list_reverse(&cp->okeys);
+}
diff --git a/tests/during-dev.sh b/tests/during-dev.sh
index 7a52e82..5948b2d 100755
--- a/tests/during-dev.sh
+++ b/tests/during-dev.sh
@@ -70,7 +70,7 @@
 # space characters in them, quote the full value
 numjobs=8
 builddir=build
-outdir=
+outdir=~/.tmp
 
 
 # Set the utility name, along with its arguments and options. NOTE, for
@@ -80,9 +80,9 @@ outdir=
 # script, and once for the utility. In such cases it might be easier to
 # just add the argument/option to the final script that runs the utility
 # rather than these variables.
-utilname=
-arguments=
-options=
+utilname=match
+arguments="positions-1.txt positions-2.txt"
+options="--aperture=0.5 --log --output=match-positions.fits"
 
 
 
diff --git a/tests/mkprof/mosaic1.sh b/tests/mkprof/mosaic1.sh
index 10eafa6..5f52742 100755
--- a/tests/mkprof/mosaic1.sh
+++ b/tests/mkprof/mosaic1.sh
@@ -54,5 +54,5 @@ if [ ! -f $cat      ]; then echo "$cat does not exist.";   
exit 77; fi
 # `check_with_program' can be something like `Valgrind' or an empty
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
-$check_with_program $execname $cat --naxis=100,100 && mv 0_mkprofcat1.fits \
-                              psf.fits
+$check_with_program $execname $cat --mergedsize=100,100      \
+                    && mv 0_mkprofcat1.fits psf.fits
diff --git a/tests/mkprof/mosaic2.sh b/tests/mkprof/mosaic2.sh
index 7aa6b67..d5043e6 100755
--- a/tests/mkprof/mosaic2.sh
+++ b/tests/mkprof/mosaic2.sh
@@ -59,4 +59,5 @@ if [ ! -f $cat      ]; then echo "$cat does not exist.";   
exit 77; fi
 # `check_with_program' can be something like `Valgrind' or an empty
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
-$check_with_program $execname $cat --naxis=100,100 --crpix=-99,1 --individual
+$check_with_program $execname $cat --mergedsize=100,100 --crpix=-99,1 \
+                    --individual
diff --git a/tests/mkprof/mosaic3.sh b/tests/mkprof/mosaic3.sh
index 7de1e43..4d530c4 100755
--- a/tests/mkprof/mosaic3.sh
+++ b/tests/mkprof/mosaic3.sh
@@ -56,4 +56,4 @@ if [ ! -f $cat      ]; then echo "$cat does not exist.";   
exit 77; fi
 # `check_with_program' can be something like `Valgrind' or an empty
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
-$check_with_program $execname $cat --naxis=100,100 --crpix=1,-99
+$check_with_program $execname $cat --mergedsize=100,100 --crpix=1,-99
diff --git a/tests/mkprof/mosaic4.sh b/tests/mkprof/mosaic4.sh
index 64a4013..e894a3e 100755
--- a/tests/mkprof/mosaic4.sh
+++ b/tests/mkprof/mosaic4.sh
@@ -57,4 +57,4 @@ if [ ! -f $cat      ]; then echo "$cat does not exist.";   
exit 77; fi
 # `check_with_program' can be something like `Valgrind' or an empty
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
-$check_with_program $execname $cat --naxis=100,100 --crpix=-99,-99
+$check_with_program $execname $cat --mergedsize=100,100 --crpix=-99,-99
diff --git a/tests/mkprof/radeccat.sh b/tests/mkprof/radeccat.sh
index 83c17fe..7363cf8 100755
--- a/tests/mkprof/radeccat.sh
+++ b/tests/mkprof/radeccat.sh
@@ -53,4 +53,4 @@ if [ ! -f $cat      ]; then echo "$cat does not exist.";   
exit 77; fi
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
 $check_with_program $execname $cat --ccol=RA --ccol=Dec --mode=wcs   \
-                              --naxis=100,100
+                              --mergedsize=100,100



reply via email to

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