gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master abe82cb 086/113: Imported recent work in maste


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master abe82cb 086/113: Imported recent work in master, no conflicts
Date: Fri, 16 Apr 2021 10:33:55 -0400 (EDT)

branch: master
commit abe82cb62e43f97a061e682f7831f836c847865c
Merge: a42ac37 01b2639
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Imported recent work in master, no conflicts
    
    There weren't any conflicts in this merge.
---
 NEWS                             |  11 +--
 THANKS                           |   1 +
 bin/mkcatalog/ui.c               |   8 +-
 bin/mknoise/main.h               |   4 +-
 bin/mknoise/mknoise.c            |   7 +-
 bin/mknoise/ui.c                 |  14 +--
 bin/mkprof/main.h                |   1 +
 bin/mkprof/mkprof.c              |   8 +-
 bin/mkprof/ui.c                  |   8 +-
 bin/noisechisel/detection.c      |   2 +-
 bootstrap.conf                   |   1 +
 configure.ac                     | 191 ++++++++++++++++++++++-----------------
 doc/announce-acknowledge.txt     |   2 +
 doc/gnuastro.en.html             |   3 +-
 doc/gnuastro.fr.html             |   2 +-
 doc/gnuastro.texi                |  90 +++++++++++-------
 doc/release-checklist.txt        |  22 +++--
 lib/checkset.c                   |  57 +++++++++++-
 lib/gnuastro-internal/checkset.h |  10 +-
 lib/statistics.c                 |  17 +++-
 20 files changed, 286 insertions(+), 173 deletions(-)

diff --git a/NEWS b/NEWS
index c23d08a..f0761ef 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,6 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
     --onedasimage: write output as an image if it has one dimension, not table.
 
   NoiseChisel:
-
     - New outlier identification algorithm for quantile thresholds. This is
       very useful when there are extended and bright sources in the
       dataset: the tiles containing very faint signal that pass the general
@@ -83,11 +82,11 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
           FITS keyword `NAXIS'.
 
   NoiseChisel:
-    --meanmedqdiff: new name for `--modmedqdiff'. Until now, the mode's
-      quantile was used to identify tiles with no significant signal. But
-      from this version, the mean's quantile in each tile is used
-      instead. The reason is that the mean is more sensative to outliers
-      (signal).
+    - Until now, the mode's quantile was used to identify tiles with no
+      significant signal. But from this version, the mean's quantile in
+      each tile is used instead. The reason is that the mean is more
+      sensitive to outliers (signal). Therefore the old `--modmedqdiff' is
+      now called `--meanmedqdiff' .
 
   Statistics:
     --meanmedqdiff: new name for `--modmedqdiff'. Similar to NoiseChisel.
diff --git a/THANKS b/THANKS
index f55b913..6a6ea2a 100644
--- a/THANKS
+++ b/THANKS
@@ -50,6 +50,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Dmitrii Oparin                       doparin2@gmail.com
     Bertrand Pain                        bertrand.pain@inserm.fr
     William Pence                        william.pence@nasa.gov
+    Mamta Pommier                        mamta.pommier@univ-lyon1.fr
     Bob Proulx                           bob@proulx.com
     Teymoor Saifollahi                   teymur.saif@gmail.com
     Yahya Sefidbakht                     y.sefidbakht@gmail.com
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 6f4a41a..836d32f 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -1353,13 +1353,7 @@ ui_preparations_upperlimit(struct mkcatalogparams *p)
           "that is reported as the upper-limit");
 
   /* Set the random number generator. */
-  gsl_rng_env_setup();
-  p->rng=gsl_rng_alloc(gsl_rng_ranlxs1);
-  p->seed = ( p->envseed
-              ? gsl_rng_default_seed
-              : gal_timing_time_based_rng_seed() );
-  if(p->envseed) gsl_rng_set(p->rng, p->seed);
-  p->rngname=gsl_rng_name(p->rng);
+  p->rng=gal_checkset_gsl_rng(p->envseed, &p->rngname, &p->seed);
 
   /* Keep the minimum and maximum values of the random number generator. */
   p->rngmin=gsl_rng_min(p->rng);
diff --git a/bin/mknoise/main.h b/bin/mknoise/main.h
index 25ab114..c443f2c 100644
--- a/bin/mknoise/main.h
+++ b/bin/mknoise/main.h
@@ -54,8 +54,8 @@ struct mknoiseparams
   gal_data_t      *input;    /* Input image data in double precision.    */
   double      background;    /* Background in units of brightness.       */
   gsl_rng           *rng;    /* Main instance of random number generator.*/
-  char         *rng_type;    /* The type of the Random number gen.       */
-  int64_t       rng_seed;    /* Seed of Random number generator.         */
+  const char   *rng_name;    /* The type/name of the Random number gen.  */
+  uint64_t      rng_seed;    /* Seed of Random number generator.         */
   time_t         rawtime;    /* Starting time of the program.            */
 };
 
diff --git a/bin/mknoise/mknoise.c b/bin/mknoise/mknoise.c
index 9abbfe1..5c9d085 100644
--- a/bin/mknoise/mknoise.c
+++ b/bin/mknoise/mknoise.c
@@ -87,10 +87,11 @@ convertsaveoutput(struct mknoiseparams *p)
     }
   strcpy(keyname4, "RNGTYPE");
   gal_fits_key_list_add_end(&headers, GAL_TYPE_STRING, keyname4, 0,
-                            p->rng_type, 0, "Random number generator (by "
-                            "GSL) type.",  0, NULL);
+                            (void *)(p->rng_name), 0,
+                            "Random number generator (by GSL) type.",
+                            0, NULL);
   strcpy(keyname5, "RNGSEED");
-  gal_fits_key_list_add_end(&headers, GAL_TYPE_INT64, keyname5, 0,
+  gal_fits_key_list_add_end(&headers, GAL_TYPE_UINT64, keyname5, 0,
                             &p->rng_seed, 0,
                             "Random number generator (by GSL) seed.",
                             0, NULL);
diff --git a/bin/mknoise/ui.c b/bin/mknoise/ui.c
index 2ab9849..54a807d 100644
--- a/bin/mknoise/ui.c
+++ b/bin/mknoise/ui.c
@@ -311,13 +311,7 @@ ui_preparations(struct mknoiseparams *p)
 
 
   /* Allocate the random number generator: */
-  gsl_rng_env_setup();
-  p->rng=gsl_rng_alloc(gsl_rng_ranlxs1);
-  p->rng_seed = ( p->envseed
-                  ? gsl_rng_default_seed
-                  : gal_timing_time_based_rng_seed() );
-  gsl_rng_set(p->rng, p->rng_seed);
-  gal_checkset_allocate_copy(gsl_rng_name(p->rng), &p->rng_type);
+  p->rng=gal_checkset_gsl_rng(p->envseed, &p->rng_name, &p->rng_seed);
 }
 
 
@@ -404,10 +398,9 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
mknoiseparams *p)
     {
       printf(PROGRAM_NAME" "PACKAGE_VERSION" started on %s",
              ctime(&p->rawtime));
-      sprintf(message, "Random number generator type: %s",
-              gsl_rng_name(p->rng));
+      sprintf(message, "Random number generator type: %s", p->rng_name);
       gal_timing_report(NULL, message, 1);
-      sprintf(message, "Random number generator seed: %"PRId64, p->rng_seed);
+      sprintf(message, "Random number generator seed: %"PRIu64, p->rng_seed);
       gal_timing_report(NULL, message, 1);
     }
 }
@@ -439,7 +432,6 @@ ui_free_report(struct mknoiseparams *p, struct timeval *t1)
 {
   /* Free the allocated arrays: */
   free(p->cp.hdu);
-  free(p->rng_type);
   free(p->cp.output);
   gal_data_free(p->input);
 
diff --git a/bin/mkprof/main.h b/bin/mkprof/main.h
index ededc0f..aa908bc 100644
--- a/bin/mkprof/main.h
+++ b/bin/mkprof/main.h
@@ -177,6 +177,7 @@ struct mkprofparams
   float                  *t;  /* Truncation distance.                     */
   gsl_rng              *rng;  /* Main instance of random number generator.*/
   const char      *rng_name;  /* Name of random number generator.         */
+  uint64_t         rng_seed;  /* Fixed seed of random number generator.   */
   time_t            rawtime;  /* Starting time of the program.            */
   double               *cat;  /* Input catalog.                           */
   gal_data_t           *log;  /* Log data to be printed.                  */
diff --git a/bin/mkprof/mkprof.c b/bin/mkprof/mkprof.c
index fba9ce4..2f575b4 100644
--- a/bin/mkprof/mkprof.c
+++ b/bin/mkprof/mkprof.c
@@ -222,12 +222,12 @@ saveindividual(struct mkonthread *mkp)
   gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "TRUNCATION", 0,
                         &p->t[id], 0, "Truncation of profile in catalog",
                         0, NULL);
-  gal_fits_key_list_add(&keys, GAL_TYPE_LONG, "RNGSEED", 0,
-                        &mkp->rng_seed, 0, "Seed of random number generator",
-                        0, NULL);
   gal_fits_key_list_add(&keys, GAL_TYPE_STRING, "RNGNAME", 0,
                         (void *)(p->rng_name), 0,
                         "Name of random number generator", 0, NULL);
+  gal_fits_key_list_add(&keys, GAL_TYPE_LONG, "RNGSEED", 0,
+                        &mkp->rng_seed, 0, "Seed of random number generator",
+                        0, NULL);
   gal_fits_key_list_add(&keys, GAL_TYPE_SIZE_T, "NUMRANDOM", 0,
                         &p->numrandom, 0,
                         "Number of random points in central pixels", 0, NULL);
@@ -322,7 +322,7 @@ mkprof_build_single(struct mkonthread *mkp, long *fpixel_i, 
long *lpixel_i,
   /* Set the seed of the random number generator if the
      environment is not to be used. */
   if(mkp->p->envseed)
-    mkp->rng_seed=mkp->p->envseed;
+    mkp->rng_seed=mkp->p->rng_seed;
   else
     {
       mkp->rng_seed=gal_timing_time_based_rng_seed();
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index a4801f1..7cc505c 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -1683,10 +1683,8 @@ ui_preparations(struct mkprofparams *p)
   if(p->wcs)
     ui_finalize_coordinates(p);
 
-  /* Allocate the random number generator: */
-  gsl_rng_env_setup();
-  p->rng=gsl_rng_alloc(gsl_rng_ranlxs1);
-  p->rng_name=gsl_rng_name(p->rng);
+  /* Prepare the random number generator. */
+  p->rng=gal_checkset_gsl_rng(p->envseed, &p->rng_name, &p->rng_seed);
 
   /* Make the log linked list. */
   ui_make_log(p);
@@ -1769,6 +1767,8 @@ ui_print_intro(struct mkprofparams *p)
       gal_timing_report(NULL, jobname, 1);
       free(jobname);
     }
+  else
+    gal_timing_report(NULL, "RNG seed differs for each profile.", 1);
 
   if(p->kernel==NULL)
     {
diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index 336d619..016bacc 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -486,7 +486,7 @@ static void
 detection_sn_write_to_file(struct noisechiselparams *p, gal_data_t *sn,
                            gal_data_t *snind, int s0d1D2)
 {
-  char *str, *extname;
+  char *str, *extname=NULL;
   gal_list_str_t *comments=NULL;
 
   /* Comment for extension on further explanation. */
diff --git a/bootstrap.conf b/bootstrap.conf
index 9c6d47b..32118c1 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -227,6 +227,7 @@ gnulib_modules="
     mbstok_r
     inttypes
     system-posix
+    secure_getenv
     git-version-gen
 "
 
diff --git a/configure.ac b/configure.ac
index 19c2d1b..f8e9530 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,13 +247,14 @@ AC_MSG_RESULT( $path_warning )
 
 
 
-# Search for necessary libraries. After each library is found,
-# AC_SEARCH_LIBS adds the -lLIBRARY flag to the LIBS variable which is then
-# given to all the Makefiles. Each new flag is added to the left of the old
-# one so order matters here. Note that the LIBS variable is also used in
-# checking the next libraries, so the linking with their dependent
-# libraries is done automatically with this order, and we don't have to
-# explicitly set the dependency flags.
+# Mandatory dependencies
+#
+# After each library is found, AC_SEARCH_LIBS adds the -lLIBRARY flag to
+# the LIBS variable which is then given to all the Makefiles. Each new flag
+# is added to the left of the old one so order matters here. Note that the
+# LIBS variable is also used in checking the next libraries, so the linking
+# with their dependent libraries is done automatically with this order, and
+# we don't have to explicitly set the dependency flags.
 has_gsl=yes
 has_cmath=yes
 has_wcslib=yes
@@ -279,58 +280,6 @@ AC_SEARCH_LIBS([ffopen], [cfitsio], [],
 AC_SEARCH_LIBS([wcspih], [wcs], [],
                [missing_mandatory=yes; has_wcslib=no])
 
-
-
-
-
-# If any necessary dependency is missing inform the user and abort.
-AS_IF([test "x$missing_mandatory" = "xyes"],
-      [
-        # Introduction.
-        AS_ECHO([""])
-        AS_ECHO(["The configure script couldn't link with the following 
mandatory dependency(s):"])
-
-        # List missing packages: print the GSL CBLAS message only if GSL is
-        # present. Otherwise, it is just confusing for the users (CBLAS
-        # will be installed with GSL). The CBLAS message is only
-        # interesting if the GSL test has passed.
-        AS_ECHO([""])
-        AS_IF([test "x$has_cmath" = "xno"],
-              [ AS_ECHO([" - C library (math): This may be the cause of all 
other failures."]) ])
-        AS_IF([test "x$has_gsl" = "xno"],
-              [ AS_ECHO([" - GNU Scientific Library (GSL): 
https://www.gnu.org/software/gsl";]) ],
-              [ AS_IF([test "x$has_gslcblas" = "xno"],
-                      [ AS_ECHO([" - The BLAS support of GNU Scientific 
Library (GSL). This should have"])
-                        AS_ECHO(["   been installed along with GSL. Try 
re-installing GSL."]) ]) ])
-        AS_IF([test "x$has_cfitsio" = "xno"],
-              [ AS_ECHO([" - CFITSIO: https://heasarc.gsfc.nasa.gov/fitsio";]) 
])
-        AS_IF([test "x$has_wcslib" = "xno"],
-              [ AS_ECHO([" - WCSLIB: 
http://www.atnf.csiro.au/people/mcalabre/WCS";]) ])
-
-        # Suggestions on fixing the problem.
-        AS_ECHO([""])
-        AS_ECHO(["You can use your package manager for easy and fast 
installation of all the"])
-        AS_ECHO(["mandatory and optional dependencies in one command. See the 
link below:"])
-        AS_ECHO(["  
https://www.gnu.org/software/gnuastro/manual/html_node/Dependencies-from-package-managers.html";])
-        AS_ECHO([""])
-        AS_ECHO(["If you have already installed a dependency (for example in 
\`/install/path'),"])
-        AS_ECHO(["but this script can't link with it, add the path to the 
LDFLAGS, CPPFLAGS and"])
-        AS_ECHO(["LD_LIBRARY_PATH environment variables before running 
configure. For example"])
-        AS_ECHO(["with the following commands (just correct the 
\`/install/path' part)."])
-        AS_ECHO(["  $ export LDFLAGS=\"\$LDFLAGS -L/install/path/lib\""])
-        AS_ECHO(["  $ export CPPFLAGS=\"\$CPPFLAGS -L/install/path/include\""])
-        AS_ECHO(["  $ export 
LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:/install/path/lib\""])
-        AS_ECHO(["[TIP] Put these commands in your startup file (for example 
\`~/.bashrc') to"])
-        AS_ECHO(["avoid similar problems later. See the link below to learn 
more:"])
-        AS_ECHO(["  
https://www.gnu.org/software/gnuastro/manual/html_node/Installation-directory.html";])
-        AS_ECHO([""])
-        AC_MSG_ERROR([Mandatory dependency(s) missing, see above.])
-      ])
-
-
-
-
-
 # These are secondary tests for more fine-grained control in libraries that
 # have already been checked. We don't need to add them to the LIBS
 # variable, so we are using AC_CHECK_LIB for these tests.
@@ -515,6 +464,77 @@ AM_CONDITIONAL([COND_HASGHOSTSCRIPT], [test 
"x$has_ghostscript" = "xyes"])
 
 
 
+# If any necessary dependency is missing inform the user and abort.
+AS_IF([test "x$missing_mandatory" = "xyes"],
+      [
+        # List missing packages: print the GSL CBLAS message only if GSL is
+        # present. Otherwise, it is just confusing for the users (CBLAS
+        # will be installed with GSL). The CBLAS message is only
+        # interesting if the GSL test has passed.
+        AS_ECHO([""])
+        AS_ECHO(["Missing MANDATORY dependencies (necessary to continue):"])
+        AS_IF([test "x$has_cmath" = "xno"],
+              [ AS_ECHO([" - C library (math): This may be the cause of all 
other failures."]) ])
+        AS_IF([test "x$has_gsl" = "xno"],
+              [ AS_ECHO([" - GNU Scientific Library (GSL): 
https://www.gnu.org/software/gsl";]) ],
+              [ AS_IF([test "x$has_gslcblas" = "xno"],
+                      [ AS_ECHO([" - The BLAS support of GNU Scientific 
Library (GSL). This should have"])
+                        AS_ECHO(["   been installed along with GSL. Try 
re-installing GSL."]) ]) ])
+        AS_IF([test "x$has_cfitsio" = "xno"],
+              [ AS_ECHO([" - CFITSIO: https://heasarc.gsfc.nasa.gov/fitsio";]) 
])
+        AS_IF([test "x$has_wcslib" = "xno"],
+              [ AS_ECHO([" - WCSLIB: 
http://www.atnf.csiro.au/people/mcalabre/WCS";]) ])
+
+        # Optional dependencies:
+        AS_IF([test "x$anywarnings" = xyes],
+              [
+                AS_ECHO([""])
+                AS_ECHO(["OPTIONAL warnings/dependencies (for improved 
functionality):"])
+                AS_IF([test "x$gsl_version_old" = "xyes"],
+                      [ AS_ECHO([" - Old GSL version: 
https://www.gnu.org/s/gsl";])                ])
+                AS_IF([test "x$has_libjpeg" = "xno"],
+                      [ AS_ECHO([" - Missing Libjpeg (JPEG files): 
http://ijg.org";])              ])
+                AS_IF([test "x$has_libtiff" = "xno"],
+                      [ AS_ECHO([" - Missing Libtiff (TIFF files): 
http://libtiff.maptools.org";]) ])
+                AS_IF([test "x$has_libgit2" = "x0"],
+                      [ AS_ECHO([" - Missing Libgit2: https://libgit2.org";])   
                   ])
+                AS_IF([test "x$usable_libtool" = "xno"],
+                      [ AS_ECHO([" - Unusable GNU Libtool: 
https://www.gnu.org/s/libtool";])
+                        AS_IF([test "x$has_gnulibtool" = "xyes"],
+                              [ AS_ECHO(["  -- GNU Libtool is present, tested 
shells not supported."])  ])
+                        AS_IF([test "x$has_libtool" = "xyes"],
+                              [ AS_ECHO(["  -- A libtool implementation was 
found, but it isn't GNU."]) ])
+                      ])
+                AS_IF([test "x$has_ghostscript" = "xno"],
+                      [ AS_ECHO([" - Missing GPL Ghostscript (v9.10 or later): 
https://www.ghostscript.com";])])
+              ])
+
+        # Suggestions on fixing the problem.
+        AS_ECHO([""])
+        AS_ECHO(["You can use your package manager for easy and fast 
installation of all"])
+        AS_ECHO(["dependencies in one command. See the link below:"])
+        AS_ECHO(["  
https://www.gnu.org/s/gnuastro/manual/html_node/Dependencies-from-package-managers.html";])
+        AS_ECHO([""])
+        AS_ECHO(["If you have already installed a dependency (for example in 
\`/install/path'),"])
+        AS_ECHO(["but this script can't link with it, add the path to the 
LDFLAGS, CPPFLAGS and"])
+        AS_ECHO(["LD_LIBRARY_PATH environment variables before running 
configure. For example"])
+        AS_ECHO(["with the following commands (just correct the 
\`/install/path' part)."])
+        AS_ECHO(["  $ export LDFLAGS=\"\$LDFLAGS -L/install/path/lib\""])
+        AS_ECHO(["  $ export CPPFLAGS=\"\$CPPFLAGS -I/install/path/include\""])
+        AS_ECHO(["  $ export 
LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:/install/path/lib\""])
+        AS_ECHO([""])
+        AS_ECHO(["[TIP:] Put these commands in your startup file (for example 
\`~/.bashrc') to"])
+        AS_ECHO(["avoid similar problems later. See the link below to learn 
more:"])
+        AS_ECHO(["  
https://www.gnu.org/s/gnuastro/manual/html_node/Installation-directory.html";])
+        AS_ECHO([""])
+        AS_ECHO([""])
+        AC_MSG_ERROR([Mandatory dependency(s) missing, === SEE MESSAGE ABOVE 
===.])
+      ])
+
+
+
+
+
 # Gnulib checks:
 gl_INIT
 
@@ -827,40 +847,41 @@ AS_IF([test x$enable_guide_message = xyes],
         AS_ECHO([])
 
         AS_IF([test "x$gsl_version_old" = "xyes"],
-              [AS_ECHO(["  - The version of GNU Scientific Library (GSL) on 
this system doesn't"])
-               AS_ECHO(["    have some features that can be useful in 
Gnuastro. This build"])
-               AS_ECHO(["    won't crash, but Gnuastro will have less 
functionality afterwards."])
-               AS_ECHO(["    We thus recommend building and installing a more 
recent version"])
-               AS_ECHO(["    of GSL (version >= 2.0, released in October 
2015)."])
+              [AS_ECHO(["  - GNU Scientific Library (GSL: 
https://www.gnu.org/s/gsl) version"])
+               AS_ECHO(["    on this system doesn't have some features that 
can be useful in"])
+               AS_ECHO(["    some parts of Gnuastro. This build won't crash, 
but Gnuastro will"])
+               AS_ECHO(["    have less functionality afterwards. We thus 
recommend building"])
+               AS_ECHO(["    and installing a more recent version of GSL 
(version >= 2.0,"])
+               AS_ECHO(["    released in October 2015)."])
                AS_ECHO([]) ])
 
         AS_IF([test "x$has_libjpeg" = "xno"],
-              [AS_ECHO(["  - libjpeg, could not be linked with in your library 
search path."])
-               AS_ECHO(["    If JPEG inputs/outputs are requested, the 
respective tool will"])
-               AS_ECHO(["    inform you and abort with an error."])
+              [AS_ECHO(["  - libjpeg (http://ijg.org), could not be linked 
with in your library"])
+               AS_ECHO(["    search path. If JPEG inputs/outputs are 
requested, the respective"])
+               AS_ECHO(["    tool will inform you and abort with an error."])
                AS_ECHO([]) ])
 
         AS_IF([test "x$has_libtiff" = "xno"],
-              [AS_ECHO(["  - libtiff, could not be linked with in your library 
search path."])
-               AS_ECHO(["    If TIFF inputs/outputs are requested, the 
respective tool will"])
-               AS_ECHO(["    inform you and abort with an error."])
+              [AS_ECHO(["  - libtiff (http://libtiff.maptools.org), could not 
be linked with in"])
+               AS_ECHO(["    your library search path. If TIFF inputs/outputs 
are requested, the"])
+               AS_ECHO(["    respective tool will inform you and abort with an 
error."])
                AS_ECHO([]) ])
 
         AS_IF([test "x$has_libgit2" = "x0"],
-              [AS_ECHO(["  - libgit2, could not be linked with in your library 
search path."])
-               AS_ECHO(["    When present, Git's describe output will be 
stored in the"])
-               AS_ECHO(["    output files if Gnuastro's programs were called 
within a Git"])
-               AS_ECHO(["    version controlled directory to help in 
reproducibility."])
+              [AS_ECHO(["  - libgit2 (https://libgit2.org), could not be 
linked with in your"])
+               AS_ECHO(["    library search path. When present, Git's describe 
output will be"])
+               AS_ECHO(["    stored in the output files if Gnuastro's programs 
were called"])
+               AS_ECHO(["    within a Gitversion controlled directory to help 
in reproducibility."])
                AS_ECHO([]) ])
 
         AS_IF([test "x$usable_libtool" = "xno"],
-              [AS_ECHO(["  - GNU Libtool can't be used on this system (see 
below)."])
-               AS_ECHO(["    Gnuastro's BuildProgram uses GNU libtool to link 
your source code"])
-               AS_ECHO(["    with the various libraries (Gnuastro's 
dependencies). Therefore"])
-               AS_ECHO(["    BuildProgram will not be built or installed. 
Please note that"])
-               AS_ECHO(["    not having GNU libtool in your search path will 
not harm the rest"])
-               AS_ECHO(["    of Gnuastro's building and installation. Gnuastro 
has its own"])
-               AS_ECHO(["    internal implementation of GNU Libtool to build 
its self. This"])
+              [AS_ECHO(["  - GNU Libtool (https://www.gnu.org/s/libtool) can't 
be used on this"])
+               AS_ECHO(["    system (see below). Gnuastro's BuildProgram uses 
GNU libtool to"])
+               AS_ECHO(["    link your source code with the various libraries 
(Gnuastro's"])
+               AS_ECHO(["    dependencies). Therefore BuildProgram will not be 
built or installed."])
+               AS_ECHO(["    Please note that not having GNU libtool in your 
search path will not"])
+               AS_ECHO(["    harm the rest of Gnuastro's building and 
installation. Gnuastro has"])
+               AS_ECHO(["    its own internal implementation of GNU Libtool to 
build its self. This"])
                AS_ECHO(["    warning is only to let you know that BuildProgram 
will not be"])
                AS_ECHO(["    part of this build. The executable names searched 
were \`libtool'"])
                AS_ECHO(["    and \`glibtool'. The shells searched were \`sh', 
\`bash' and \`zsh'."])
@@ -874,9 +895,9 @@ AS_IF([test x$enable_guide_message = xyes],
               ])
 
         AS_IF([test "x$has_ghostscript" = "xno"],
-              [AS_ECHO(["  - GPL GhostScript version 9.10 or later, with the 
executable"])
-               AS_ECHO(["    name \`gs', was not found in your PATH 
environment variable."])
-               AS_ECHO(["    If PDF outputs are desired, the respective tool 
it will abort"])
+              [AS_ECHO(["  - GPL GhostScript (https://www.ghostscript.com) 
version 9.10 or later,"])
+               AS_ECHO(["    with the executable name \`gs', was not found in 
your PATH environment"])
+               AS_ECHO(["    variable. If PDF outputs are desired, the 
respective tool it will abort"])
                AS_ECHO(["    with an EPS output which you can convert to PDF 
by other means."])
                AS_ECHO([]) ])
 
@@ -901,7 +922,7 @@ AS_IF([test x$enable_guide_message = xyes],
         AS_ECHO(["  You can use your package manager for easy and fast 
installation of all"])
         AS_ECHO(["  the mandatory and optional dependencies in one command. 
See the link"])
         AS_ECHO(["  below:"])
-        AS_ECHO(["    
https://www.gnu.org/software/gnuastro/manual/html_node/Dependencies-from-package-managers.html";])
+        AS_ECHO(["    
https://www.gnu.org/s/gnuastro/manual/html_node/Dependencies-from-package-managers.html";])
         AS_ECHO([])
 
         # Inform the user on skipped tests.
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index e8e934a..815b582 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -2,4 +2,6 @@ Alphabetically ordered list to acknowledge in the next release.
 
 Pierre-Alain Duc
 Gaspar Galaz
+Mamta Pommier
 Michael Stein
+Ignacio Trujillo
diff --git a/doc/gnuastro.en.html b/doc/gnuastro.en.html
index e6a7b32..300e89f 100644
--- a/doc/gnuastro.en.html
+++ b/doc/gnuastro.en.html
@@ -125,7 +125,8 @@ Scientific
 Library</a>, <a href="manual/html_node/CFITSIO.html">CFITSIO</a>, <a 
href="manual/html_node/WCSLIB.html">WCSLIB</a>.<br />See <a 
href="manual/html_node/Dependencies-from-package-managers.html">Dependencies
 from package managers</a> for easy installation of Gnuastro's dependencies
 using tools like <code>apt-get</code>, <code>dnf</code>
-(or <code>yum</code>), <code>pacman</code> or <code>brew</code>.</p>
+(or <code>yum</code>), <code>pacman</code>, <code>zypper</code>
+or <code>brew</code>.</p>
 
 <p>For a more detailed description, see
 the <a href="manual/html_node/Installation.html">Installation</a> chapter
diff --git a/doc/gnuastro.fr.html b/doc/gnuastro.fr.html
index 7b9904d..04fd936 100644
--- a/doc/gnuastro.fr.html
+++ b/doc/gnuastro.fr.html
@@ -124,7 +124,7 @@ h3 { clear: both; }
   installation facile des d├ępendances de Gnuastro en utilisant des
   logiciels comme <code>apt-get</code>, <code>dnf</code>
   (ou <code>yum</code>),
-  <code>pacman</code> ou <code>brew</code>.</p>
+  <code>pacman</code>, <code>zypper</code> ou <code>brew</code>.</p>
 
 <p>Dans le chapitre <cite><a href="manual/html_node/Installation.html">
   Installation</a></cite>, vous trouverez des explications compl├Ętes sur
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 2390288..8014ace 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -4261,12 +4261,22 @@ more than 20 times) than the standard deviation (final 
extension). So we
 can stop configuring NoiseChisel at this point in the tutorial. We leave
 further configuration for a more accurate detection to you as an exercise.
 
-Let's see how deeply/successfully we carved out M51 and NGC 5195's tail
-from the noise. For this measurement, we'll need to estimate the average
-flux on the outer edges of the detection. Fortunately all this can be done
-with a few simple commands (and no higher-level language mini-environments)
-using @ref{Arithmetic} and @ref{MakeCatalog}. First, let's give a separate
-label to all the connected pixels of NoiseChisel's detection map:
+In this shallow image, this extent may seem too far deep into the noise for
+visual confirmation. Therefore, if the statistical argument above, to
+justify the reality of this extented structure, hasn't convinced you, see
+the deep images of this system in @url{https://arxiv.org/abs/1501.04599,
+Watkins et al. [2015]}, or a 12 hour deep image of this system (with a
+12-inch telescope): @url{https://i.redd.it/jfqgpqg0hfk11.jpg}@footnote{The
+image is taken from this Reddit discussion:
+@url{https://www.reddit.com/r/Astronomy/comments/9d6x0q/12_hours_of_exposure_on_the_whirlpool_galaxy/}}.
+
+Now that we know this detection is real, let's measure how deep we carved
+the signal out of noise. For this measurement, we'll need to estimate the
+average flux on the outer edges of the detection. Fortunately all this can
+be done with a few simple commands (and no higher-level language
+mini-environments) using @ref{Arithmetic} and @ref{MakeCatalog}. First,
+let's give a separate label to all the connected pixels of NoiseChisel's
+detection map:
 
 @example
 $ astarithmetic r_detected.fits 2 connected-components -hDETECTIONS \
@@ -4347,11 +4357,12 @@ The outer wings where therefore non-parametrically 
detected until
 @mymath{\rm{S/N}\approx0.05}!
 
 @cindex Surface brightness
-This is very good, but how much is this in standard units of surface
-brightness, or magnitudes per square arcseconds? To find out, we'll first
-need to calculate how many pixels of this image are in one
+This is very good! But the signal-to-noise ratio is a relative measurement.
+Let's also measure the depth of our detection in absolute surface
+brighntess units; or magnitudes per square arcseconds. To find out, we'll
+first need to calculate how many pixels of this image are in one
 arcsecond-squared. Fortunately the world coordinate system (or WCS) meta
-data of Gnuastro's output FITS files (and in particular @code{CDELT}
+data of Gnuastro's output FITS files (in particular the @code{CDELT}
 keywords) give us this information.
 
 @example
@@ -4959,7 +4970,7 @@ is a large collection of functions that are very useful 
in scientific
 applications, for example integration, random number generation, and Fast
 Fourier Transform among many others. To install GSL from source, you can
 run the following commands after you have downloaded
-@url{ftp://ftp.gnu.org/gnu/gsl/gsl-latest.tar.gz,
+@url{http://ftpmirror.gnu.org/gsl/gsl-latest.tar.gz,
 @file{gsl-latest.tar.gz}}:
 
 @example
@@ -18565,6 +18576,8 @@ deviation of the final distribution (and thus bias the 
upper-limit
 measurement).
 
 @item --envseed
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 Read the random number generator type and seed value from the environment
 (see @ref{Generating random numbers}). Random numbers are used in
 calculating the random positions of different samples of each object.
@@ -19825,6 +19838,8 @@ distribution. This can be done by setting the 
@code{GSL_RNG_TYPE} and
 with the @option{--envseed} option. To learn more about the process of
 generating random numbers, see @ref{Generating random numbers}.
 
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 The seed values are fixed for every profile: with @option{--envseed},
 all the profiles have the same seed and without it, each will get a
 different seed using the system clock (which is accurate to within one
@@ -20321,6 +20336,8 @@ profile, see @ref{Sampling from a function}.
 
 @item -e
 @itemx --envseed
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 Use the value to the @code{GSL_RNG_SEED} environment variable to
 generate the random Monte Carlo sampling distribution, see
 @ref{Sampling from a function} and @ref{Generating random
@@ -20982,7 +20999,6 @@ affordable!}!
 
 @cindex Psudo-random numbers
 @cindex Numbers, psudo-random
-@cindex Seed, psudo-random numbers
 Using only software, we can only produce what is called a psudo-random
 sequence of numbers. A true random number generator is a hardware (let's
 assume we have made sure it has no systematic biases), for example
@@ -21008,17 +21024,19 @@ them!). Through the two environment variables 
@code{GSL_RNG_TYPE} and
 @code{GSL_RNG_SEED} you can specify the generator and its seed
 respectively.
 
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 If you don't specify a value for @code{GSL_RNG_TYPE}, GSL will use its
-default random number generator type. The default type is sufficient
-for most general applications. If no value is given for the
-@code{GSL_RNG_SEED} environment variable and you have asked Gnuastro
-to read the seed from the environment (through the @option{--envseed}
-option), then GSL will use the default value of each generator to give
-identical outputs. If you don't explicitly tell Gnuastro programs to
-read the seed value from the environment variable, then they will use
-the system time (accurate to within a microsecond) to generate
-(apparently random) seeds. In this manner, every time you run the
-program, you will get a different random number distribution.
+default random number generator type. The default type is sufficient for
+most general applications. If no value is given for the @code{GSL_RNG_SEED}
+environment variable and you have asked Gnuastro to read the seed from the
+environment (through the @option{--envseed} option), then GSL will use the
+default value of each generator to give identical outputs. If you don't
+explicitly tell Gnuastro programs to read the seed value from the
+environment variable, then they will use the system time (accurate to
+within a microsecond) to generate (apparently random) seeds. In this
+manner, every time you run the program, you will get a different random
+number distribution.
 
 There are two ways you can specify values for these environment
 variables. You can call them on the same command-line for example:
@@ -21063,16 +21081,20 @@ can see the top few lines of the output of 
MakeProfiles:
 @example
 $ export GSL_RNG_TYPE="taus"
 $ export GSL_RNG_SEED=345
-$ astmkprof catalog.txt --envseed
+$ astmkprof -s1 --kernel=gaussian,2,5 --envseed
 GSL_RNG_TYPE=taus
 GSL_RNG_SEED=345
-MakeProfiles started on AAA BBB DD EE:FF:GG HHH
-  - 6 profiles read from catalog.txt 0.000236 seconds
-  - Random number generator (RNG) type: taus
+MakeProfiles A.B started on DDD MMM DD HH:MM:SS YYYY
+  - Building one gaussian kernel
+  - Random number generator (RNG) type: ranlxs1
   - RNG seed for all profiles: 345
+  ---- ./kernel.fits created.
+MakeProfiles finished in 0.111271 seconds
 @end example
 
 @noindent
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 The first two output lines (showing the names of the environment
 variables) are printed by GSL before MakeProfiles actually starts
 generating random numbers. The Gnuastro programs will report the
@@ -21144,6 +21166,8 @@ noise}.
 
 @item -e
 @itemx --envseed
+@cindex Seed, Random number generator
+@cindex Random number generator, Seed
 Use the @code{GSL_RNG_SEED} environment variable for the seed used in
 the random number generator, see @ref{Generating random numbers}. With
 this option, the output image noise is always going to be identical
@@ -27834,10 +27858,10 @@ sort-related bit flags accordingly.
 
 @deftypefun {gal_data_t *} gal_statistics_no_blank_sorted (gal_data_t 
@code{*input}, int @code{inplace})
 Remove all the blanks and sort the input dataset. If @code{inplace} is
-non-zero this will happen on the input dataset (and the output dataset will
-be the input dataset). However, if @code{inplace} is zero, this function
-will allocate a new copy of the dataset that is sorted and has no blank
-values.
+non-zero this will happen on the input dataset (in the allocated space of
+the input dataset). However, if @code{inplace} is zero, this function will
+allocate a new copy of the dataset and work on that. Therefore if
+@code{inplace==0}, the input dataset will be modified.
 
 This function uses the bit flags of the input, so if you have modified the
 dataset, set @code{input->flags=0} before calling this function. Also note
@@ -27849,7 +27873,11 @@ If all the elements were blank, then the returned 
dataset's @code{size}
 will be zero. This is thus a good parameter to check after calling this
 function to see if there actually were any non-blank elements in the input
 or not and take the appropriate measure. This can help avoid strange bugs
-in later steps.
+in later steps. The flags of a zero-sized returned dataset will indicate
+that it has no blanks and is sorted in an increasing order. Even if having
+blank values or being sorted is not defined on a zero-element dataset, it
+is up to the caller to choose what they will do with a zero-element
+dataset. The flags have to be set after this function any way.
 @end deftypefun
 
 @deftypefun {gal_data_t *} gal_statistics_regular_bins (gal_data_t 
@code{*input}, gal_data_t @code{*inrange}, size_t @code{numbins}, double 
@code{onebinstart})
diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt
index 5a13694..1ffa2de 100644
--- a/doc/release-checklist.txt
+++ b/doc/release-checklist.txt
@@ -71,16 +71,6 @@ all the commits needed for this release have been completed.
      $ git add -u
      $ git commit
 
- - Make sure all the bootstrapping tools are up to date (keep the
-   versions in text file to use in the release), then bootstrap and
-   rebuild everything:
-
-     $ git clean -fxd
-     $ ./bootstrap --copy --gnulib-srcdir=/path/to/gnulib
-     $ ./developer-build -c -C -d     # using `-d' to speed up the build.
-     $ cd build
-     $ make distcheck -j8
-
 
  - [ALPHA] For alpha, we will only be distributing lzip tarballs. So first
    remove the `tar.gz' file that was produced by `make distcheck', then
@@ -199,6 +189,18 @@ Packaging in Debian
 
 Steps necessary to Package Gnuastro for Debian.
 
+ - Make sure the tarball is built with updated bootstrapped parts:
+
+      $ cd path/to/gnulib
+      $ git pull
+      $ cd path/to/autoconf-archives
+      $ git pull
+      $ cd gnuastro
+      $ git clean -fxd
+      $ ./bootstrap --copy --gnulib-srcdir=/path/to/gnulib
+      $ ./developer-build -p upload-server:folder
+
+
  - It would help to use the most recent versions of packages in Debian. To
    do that, you can update the `/etc/apt/sources.list' file. You can get
    the current releases from this webpage:
diff --git a/lib/checkset.c b/lib/checkset.c
index af5d01c..b58e96f 100644
--- a/lib/checkset.c
+++ b/lib/checkset.c
@@ -30,10 +30,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <unistd.h>
 #include <sys/stat.h>
 
-#include <fitsio.h>
-
 #include <gnuastro/data.h>
 
+#include <gnuastro-internal/timing.h>
 #include <gnuastro-internal/checkset.h>
 
 
@@ -44,6 +43,60 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
+/**************************************************************/
+/**********               Environment              ************/
+/**************************************************************/
+/* The GSL random number generator (RNG) reads values from the
+   environment. This function is designed to make the job easier for any
+   program using GSL's RNG. If the user doesn't want to set the */
+gsl_rng *
+gal_checkset_gsl_rng(uint8_t envseed_bool, const char **name, uint64_t *seed)
+{
+  gsl_rng *rng;
+
+  /* Let GSL read the environment and convert the type name (as string) to
+     `gsl_rng_type'. After this function, `gsl_rng_default' contains the
+     generator's type and `gsl_rng_default_seed' contains the (possibly)
+     given seed.*/
+  gsl_rng_env_setup();
+
+  /* Allocate the random number generator based on the requested type and
+     save its name. If no `GSL_RNG_TYPE' is set, then use a fixed
+     generator.*/
+  rng=gsl_rng_alloc(secure_getenv("GSL_RNG_TYPE")
+                    ? gsl_rng_default
+                    : gsl_rng_ranlxs1);
+  *name = gsl_rng_name(rng);
+
+  /* Initialize the random number generator, depending on the
+     `envseed_bool' argument. */
+  *seed = ( envseed_bool
+            ? gsl_rng_default_seed
+            : gal_timing_time_based_rng_seed() );
+  gsl_rng_set(rng, *seed);
+
+  /* Return the GSL RNG structure. */
+  return rng;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 /**************************************************************/
 /**********          My String functions:          ************/
diff --git a/lib/gnuastro-internal/checkset.h b/lib/gnuastro-internal/checkset.h
index ee6314a..204c325 100644
--- a/lib/gnuastro-internal/checkset.h
+++ b/lib/gnuastro-internal/checkset.h
@@ -27,6 +27,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    must be included before the C++ preparations below */
 #include <math.h>
 #include <fitsio.h>
+#include <gsl/gsl_rng.h>
 #include <gnuastro-internal/options.h>
 
 /* C++ Preparations */
@@ -49,9 +50,12 @@ __BEGIN_C_DECLS  /* From C++ preparations */
 
 
 
-
-
-
+/**************************************************************/
+/**********               Environment              ************/
+/**************************************************************/
+gsl_rng *
+gal_checkset_gsl_rng(uint8_t envseed_bool, const char **name,
+                     uint64_t *seed);
 
 
 
diff --git a/lib/statistics.c b/lib/statistics.c
index ea3dee5..981bbec 100644
--- a/lib/statistics.c
+++ b/lib/statistics.c
@@ -1421,10 +1421,23 @@ gal_statistics_no_blank_sorted(gal_data_t *input, int 
inplace)
       else
         sorted=noblank;
     }
-
   /* When the input's size is zero, just return the actual input. */
   else
-    sorted=input;
+    sorted = inplace ? input : gal_data_copy(input);
+
+  /* Set the blank and sorted flags if the dataset has zero-elements. Even
+     if having blank values or being sorted is not defined on a
+     zero-element dataset, it is up to different functions to choose what
+     they will do with a zero-element dataset. The flags have to be set
+     after this function any way. */
+  if(sorted->size==0)
+    {
+      sorted->flag |= GAL_DATA_FLAG_SORT_CH;
+      sorted->flag |= GAL_DATA_FLAG_BLANK_CH;
+      sorted->flag |= GAL_DATA_FLAG_SORTED_I;
+      sorted->flag &= ~GAL_DATA_FLAG_HASBLANK;
+      sorted->flag &= ~GAL_DATA_FLAG_SORTED_D;
+    }
 
 
   /* Return final array. */



reply via email to

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