gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 218a7db 041/113: Brought in recent work from m


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 218a7db 041/113: Brought in recent work from master, corrections made
Date: Fri, 16 Apr 2021 10:33:40 -0400 (EDT)

branch: master
commit 218a7dbd850d0c9c86973037c511701317f9fe66
Merge: 9dda05c b3a3480
Author: Mohammad Akhlaghi <akhlaghi@gnu.org>
Commit: Mohammad Akhlaghi <akhlaghi@gnu.org>

    Brought in recent work from master, corrections made
    
    Recent work in master has been brought in from master and one small
    correction made: the lines calling `detection_ngb_to_connectivity', was
    broken into two.
---
 NEWS                           |  23 ++++-----
 bin/buildprog/buildprog.c      |   4 +-
 bin/noisechisel/clumps.c       |  10 ++--
 bin/noisechisel/clumps.h       |   3 +-
 bin/noisechisel/detection.c    |  16 ++++---
 bin/noisechisel/segmentation.c |  15 ++++--
 configure.ac                   |  64 +++++++++++++++++--------
 doc/announce-acknowledge.txt   |   1 +
 doc/gnuastro.texi              | 106 +++++++++++++++++++++++------------------
 lib/gnuastro/dimension.h       |   6 +++
 tests/Makefile.am              |   6 +--
 tests/buildprog/simpleio.sh    |   5 +-
 12 files changed, 163 insertions(+), 96 deletions(-)

diff --git a/NEWS b/NEWS
index 9dc225b..23b3928 100644
--- a/NEWS
+++ b/NEWS
@@ -47,7 +47,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
   MakeCatalog: The new `--uprange' option allows you to specify a range for
   the random values around each object. This is useful when the noise
-  properies of the dataset vary gradually and sampling from the whole
+  properties of the dataset vary gradually and sampling from the whole
   dataset might produce biased results.
 
   NoiseChisel: with the new `--widekernel' option it is now possible to use
@@ -143,6 +143,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
   MakeCatalog crash in upper-limit with full size label (bug #52281).
 
+  NoiseChisel leaving unlabeld regions after clump growth (bug #52327).
 
 
 
@@ -291,7 +292,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 * Noteworthy changes in release 0.3 (library 1.0.0) (2017-06-01) [stable]
 
   This is a full re-write of Gnuastro. Most importantly, Gnuastro now has a
-  new generic data contaihtner (`gal_data_t'). This new container can now
+  new generic data container (`gal_data_t'). This new container can now
   deal natively with all standard numeric data types, work in RAM or
   HDD/SSD, keep data in any dimensions and has enabled many other very
   useful features. Some of the most prominent of the new features are
@@ -325,7 +326,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   information in a plain text table, see the "Gnuastro text table format"
   section of the book. In short for every column, a comment line like below
   can be used to give a name, units, comments, or a type to a column. This
-  allows a FITS binary table for eample to be written to plain text and
+  allows a FITS binary table for example to be written to plain text and
   converted back to binary without loosing any information (except for very
   small floating point errors if not enough decimals are printed).
 
@@ -385,7 +386,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
      -- All programs will now also look for a `gnuastro.conf' configuration
         file to keep common options for all programs in every directory.
 
-     -- The `--lastconfig' opion can be used on the command-line or in any
+     -- The `--lastconfig' option can be used on the command-line or in any
         configuration file to stop parsing any further configuration files.
 
      -- The `--config' option can now be used to identify any arbitrary
@@ -482,7 +483,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   `--quantfunc' (quantile function), `--mode', `--modequant', `--modesym',
   and `--modesymvalue'.
 
-  Warp: align the image with the celestial coordiates using the `--align'
+  Warp: align the image with the celestial coordinates using the `--align'
   option.
 
   Warp: standard modular warpings can now be requested without an input
@@ -599,11 +600,11 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
   Corrected bad status usage in calls to wcsp2s and wcss2p (bug #49752).
 
-  Strickter checking in Crop's polygon point list (bug #48978).
+  Stricter checking in Crop's polygon point list (bug #48978).
 
   Correction in alignment and getting pixel scale (bug #50072).
 
-  Decomposing PCi_j and CDELTi matices in output WCS (bug #50073).
+  Decomposing PCi_j and CDELTi matrices in output WCS (bug #50073).
 
   Using image naxes[n] when checkcenter is larger (bug #50099).
 
@@ -656,7 +657,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   #14115).
 
   MakeProfiles can now use input image as canvas. Instead of specifying the
-  WSC and image size paramteres manually. With the new `--inputascanvas'
+  WSC and image size parameters manually. With the new `--inputascanvas'
   option, MakeProfiles will get this information (along with blank pixels)
   from an already existing image (task #14116).
 
@@ -691,7 +692,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   aperture photometry, when the object labels are not generated by
   NoiseChisel and so a clump image doesn't exist (task #14122).
 
-  Default cosmological parameters in CosmiCalculator set to Plank 2015
+  Default cosmological parameters in CosmicCalculator set to Plank 2015
   results: A&A (2016), 594, A13 (arXiv 1502.01589).
 
   The `--envseed' option (to read random number generator type and seed
@@ -767,7 +768,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   Convolve can now do deconvolution with the `--makekernel' option.
 
   MakeProfiles now has a `--setconsttonan' option which will fill the
-  contant profiles with a NaN (blank) value, not a number, allowing the
+  constant profiles with a NaN (blank) value, not a number, allowing the
   creations of elliptical masked regions for example.
 
   Header can now import a keyword directly from a string with the `--asis'
@@ -789,7 +790,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   pixels on its circumference.
 
   The number of CPU threads is no longer a configuration option, it is now
-  determined at runtime for each program. Therefore it is now easily
+  determined at run-time for each program. Therefore it is now easily
   possible to built Gnuastro on one system to use on another (commonly done
   in the GNU/Linux package managers). Therefore ./configure no longer has a
   `--with-numthreads' option.
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index f35236d..a0fc85c 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -96,8 +96,8 @@ buildprog(struct buildprogparams *p)
   else      asprintf(&fullla, "%s/libgnuastro.la", LIBDIR);
 
   /* Put the command to run into a string. */
-  asprintf(&command, "libtool %s --mode=link gcc %s %s %s %s %s %s %s "
-           "-I%s %s -o %s",
+  asprintf(&command, "%s %s --mode=link gcc %s %s %s %s %s %s %s "
+           "-I%s %s -o %s", GAL_CONFIG_GNULIBTOOL_EXEC,
            p->cp.quiet ? "--quiet" : "",
            warning     ? warning   : "",
            p->debug    ? "-g"      : "",
diff --git a/bin/noisechisel/clumps.c b/bin/noisechisel/clumps.c
index 8965226..04a5cab 100644
--- a/bin/noisechisel/clumps.c
+++ b/bin/noisechisel/clumps.c
@@ -544,10 +544,13 @@ clumps_grow_prepare_final(struct clumps_thread_params 
*cltprm)
 
      diffuseindexs: The indexs of the pixels that must be grown.
 
-     withrivers: as described abvoe.
+     withrivers: as described above.
+
+     connectivity: connectivity to define neighbors for growth.
 */
 void
-clumps_grow(gal_data_t *labels, gal_data_t *diffuseindexs, int withrivers)
+clumps_grow(gal_data_t *labels, gal_data_t *diffuseindexs, int withrivers,
+            int connectivity)
 {
   int searchngb;
   size_t *diarray=diffuseindexs->array;
@@ -597,7 +600,8 @@ clumps_grow(gal_data_t *labels, gal_data_t *diffuseindexs, 
int withrivers)
              in a 2D image). Note that since this macro has multiple loops
              within it, we can't use break. We'll use a variable instead. */
           searchngb=1;
-          GAL_DIMENSION_NEIGHBOR_OP(*s, labels->ndim, labels->dsize, 1, dinc,
+          GAL_DIMENSION_NEIGHBOR_OP(*s, labels->ndim, labels->dsize,
+                                    connectivity, dinc,
             {
               if(searchngb)
                 {
diff --git a/bin/noisechisel/clumps.h b/bin/noisechisel/clumps.h
index 1557955..0c300fa 100644
--- a/bin/noisechisel/clumps.h
+++ b/bin/noisechisel/clumps.h
@@ -79,7 +79,8 @@ void
 clumps_grow_prepare_final(struct clumps_thread_params *cltprm);
 
 void
-clumps_grow(gal_data_t *labels, gal_data_t *diffuseindexs, int withrivers);
+clumps_grow(gal_data_t *labels, gal_data_t *diffuseindexs, int withrivers,
+            int connectivity);
 
 void
 clumps_true_find_sn_thresh(struct noisechiselparams *p);
diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index 51c1456..3d000dd 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -106,8 +106,8 @@ detection_initial(struct noisechiselparams *p)
   /* Erode the image. */
   if(!p->cp.quiet) gettimeofday(&t1, NULL);
   gal_binary_erode(p->binary, p->erode,
-                   detection_ngb_to_connectivity(p->input->ndim, p->erodengb),
-                   1);
+                   detection_ngb_to_connectivity(p->input->ndim,
+                                                 p->erodengb), 1);
   if(!p->cp.quiet)
     {
       asprintf(&msg, "Eroded %zu time%s (%zu-connectivity).", p->erode,
@@ -131,8 +131,8 @@ detection_initial(struct noisechiselparams *p)
   /* Do the opening. */
   if(!p->cp.quiet) gettimeofday(&t1, NULL);
   gal_binary_open(p->binary, p->opening,
-                  detection_ngb_to_connectivity(p->input->ndim, p->openingngb),
-                  1);
+                  detection_ngb_to_connectivity(p->input->ndim,
+                                                p->openingngb), 1);
   if(!p->cp.quiet)
     {
       asprintf(&msg, "Opened (depth: %zu, %s connectivity).",
@@ -143,7 +143,8 @@ detection_initial(struct noisechiselparams *p)
 
 
   /* Label the connected components. */
-  p->numinitialdets=gal_binary_connected_components(p->binary, &p->olabel, 1);
+  p->numinitialdets=gal_binary_connected_components(p->binary, &p->olabel,
+                                                    p->binary->ndim);
   if(p->detectionname)
     {
       p->olabel->name="OPENED-AND-LABELED";
@@ -1010,7 +1011,7 @@ detection_quantile_expand(struct noisechiselparams *p, 
gal_data_t *workbin)
   while(++o<of);
 
   /* Expand the detections. */
-  clumps_grow(p->olabel, diffuseindexs, 0);
+  clumps_grow(p->olabel, diffuseindexs, 0, p->olabel->ndim);
 
 
   /* Only keep the 1 valued pixels in the binary array. */
@@ -1035,7 +1036,8 @@ detection_quantile_expand(struct noisechiselparams *p, 
gal_data_t *workbin)
     }
 
   /* Get the labeled image. */
-  numexpanded=gal_binary_connected_components(workbin, &p->olabel, 8);
+  numexpanded=gal_binary_connected_components(workbin, &p->olabel,
+                                              workbin->ndim);
 
   /* Set all the input's blank pixels to blank in the labeled and binary
      arrays. */
diff --git a/bin/noisechisel/segmentation.c b/bin/noisechisel/segmentation.c
index 1c4bc15..74908ef 100644
--- a/bin/noisechisel/segmentation.c
+++ b/bin/noisechisel/segmentation.c
@@ -472,7 +472,7 @@ segmentation_on_threads(void *in_prm)
           /* Grow the true clumps over the detection. */
           clumps_grow_prepare_initial(&cltprm);
           if(cltprm.diffuseindexs->size)
-            clumps_grow(p->olabel, cltprm.diffuseindexs, 1);
+            clumps_grow(p->olabel, cltprm.diffuseindexs, 1, 1);
           if(clprm->step==3)
             { gal_data_free(cltprm.diffuseindexs); continue; }
 
@@ -507,8 +507,17 @@ segmentation_on_threads(void *in_prm)
                  grown. */
               clumps_grow_prepare_final(&cltprm);
 
-              /* Cover the whole area. */
-              clumps_grow(p->olabel, cltprm.diffuseindexs, 0);
+              /* Cover the whole area (using maximum connectivity to not
+                 miss any pixels). */
+              clumps_grow(p->olabel, cltprm.diffuseindexs, 0,
+                          p->olabel->ndim);
+
+              /* Make sure all diffuse pixels are labeled. */
+              if(cltprm.diffuseindexs->size)
+                error(EXIT_FAILURE, 0, "a bug! Please contact us at %s to "
+                      "fix it. %zu pixels of detection %zu have not been "
+                      "labeled (as an object)", PACKAGE_BUGREPORT,
+                      cltprm.diffuseindexs->size, cltprm.id);
             }
           gal_data_free(cltprm.diffuseindexs);
           if(clprm->step==5) { gal_data_free(cltprm.clumptoobj); continue; }
diff --git a/configure.ac b/configure.ac
index 898770b..9bb1e44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,11 +233,30 @@ AC_SUBST(HAVE_LIBGIT2, [$has_libgit2])
 
 
 
-# Check libtool: need by BuildProgram.
+# Check the libtool executable: needed by BuildProgram.
 AC_CHECK_PROG(has_libtool, libtool, [yes], [no])
-AS_IF([test "x$has_libtool" = "xno"], [anywarnings=yes])
-AM_CONDITIONAL([COND_HASLIBTOOL], [test "x$has_libtool" = "xyes"])
 
+# If Libtool is present, make sure it is GNU Libtool
+AS_IF([test "x$has_libtool" = "xyes"],
+      [ AC_MSG_CHECKING(if libtool executable is GNU)
+        AS_IF( libtool --version 2> /dev/null | grep GNU 2>&1 > /dev/null,
+               [has_gnulibtool=yes], [has_gnulibtool=no])
+        AC_MSG_RESULT( $has_gnulibtool )],
+      [ has_gnulibtool=no ])
+
+# When either the `libtool' executable isn't GNU or it doesn't exist, then
+# look for `glibtool'.
+AS_IF([test "x$has_gnulibtool" = "xyes"],
+      [ gnulibtool_exec=libtool ],
+      [ AC_CHECK_PROG(has_glibtool, glibtool, [yes], [no])
+        AS_IF( [test "x$has_glibtool" = "xyes"],
+               [has_gnulibtool=yes; gnulibtool_exec=glibtool],
+               [has_gnulibtool=no; anywarnings=yes] ) ])
+
+# Write the test results in the Makefiles and `config.h'.
+AM_CONDITIONAL([COND_HASGNULIBTOOL], [test "x$has_gnulibtool" = "xyes"])
+AC_DEFINE_UNQUOTED([GAL_CONFIG_GNULIBTOOL_EXEC], ["$gnulibtool_exec"],
+                   [The executable to call GNU Libtool])
 
 
 
@@ -574,16 +593,11 @@ AC_ARG_ENABLE([warp],
 
 
 
-# If we had a "ano" variable to be "true" if there was a no, then we
-# would get. So we see we have no need for such a variable.
-#
-# if [ ano == true ]; then
-#    every "notset" becomes yes.        if [ ayes == true ]; then
-# elif [ ayes == true ]; then                 every "notset" becomes "no"
-#    every "notset" becomes no.   ==>   else
-# else                                        every "notset" becomes "yes"
-#    every "notset"  becomes yes.       fi
-# fi
+
+# If we had a "ayes" variable to be "true" if there was a `yes'. So any
+# program that is not explicitly requested must be ignored and vice versa
+# (if no programs were explicly requested, the enable all that weren't
+# disabled).
 AS_IF([test $ayes = true ],
       [
        AS_IF([test $enable_arithmetic = notset], [enable_arithmetic=no])
@@ -626,6 +640,14 @@ AS_IF([test $ayes = true ],
 
 
 
+# BuildProgram depends on the presence of GNU Libtool, if it isn't present,
+# then don't build it.
+AS_IF([test "x$has_gnulibtool" = "xno"], [enable_buildprog=no])
+
+
+
+
+
 # Make the enable_package values available for the Makefile:
 AM_CONDITIONAL([COND_ARITHMETIC], [test $enable_arithmetic = yes])
 AM_CONDITIONAL([COND_BUILDPROG], [test $enable_buildprog = yes])
@@ -731,13 +753,17 @@ AS_IF([test x$enable_guide_message = xyes],
                AS_ECHO(["    output files if Gnuastro's programs were called 
within a Git"])
                AS_ECHO(["    version controlled directory to help in 
reproducibility."])
                AS_ECHO([]) ])
-        AS_IF([test "x$has_libtool" = "xno"],
+        AS_IF([test "x$has_gnulibtool" = "xno"],
               [AS_ECHO(["  - GNU Libtool, could not be found in your search 
path."])
-               AS_ECHO(["    Gnuastro's BuildProgram uses libtool to link your 
source code"])
-               AS_ECHO(["    with the various libraries (Gnuastro's 
dependencies). Note that"])
-               AS_ECHO(["    not having libtool in your search path will not 
harm Gnuastro's"])
-               AS_ECHO(["    building and installation process. This warning 
is only for"])
-               AS_ECHO(["    using BuildProgram after Gnuastro has been built 
and installed."])
+               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(["    BuildProgarm 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(["    warning is only to let you know that BuildProgram 
will not be"])
+               AS_ECHO(["    built and installed. The executable names 
searched were \`libtool'"])
+               AS_ECHO(["    and \`glibtool'."])
                AS_ECHO([]) ])
         AS_IF([test "x$has_ghostscript" = "xno"],
               [AS_ECHO(["  - GPL GhostScript version 9.10 or later, with the 
executable"])
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index ac2b000..a2f766a 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -4,4 +4,5 @@ acknowledged in the next release.
 Leindert Boogaard
 Aurélien Jarno
 Takashi Ichikawa
+Alan Lefor
 David Valls-Gabaud
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 4a1c658..3250609 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -141,15 +141,15 @@ in project history):
 @*
 @*
 @*
-For myself, I am interested in science and in philosophy only because
-I want to learn something about the riddle of the world in which we
-live, and the riddle of man’s knowledge of that world. And I believe
-that only a revival of interest in these riddles can save the sciences
-and philosophy from narrow specialization and from an obscurantist
-faith in the expert’s special skill, and in his personal knowledge and
-authority; a faith that so well fits our ‘post-rationalist’ and
-‘post-critical’ age, proudly dedicated to the destruction of the
-tradition of rational philosophy, and of rational thought itself.
+For myself, I am interested in science and in philosophy only because I
+want to learn something about the riddle of the world in which we live, and
+the riddle of man's knowledge of that world. And I believe that only a
+revival of interest in these riddles can save the sciences and philosophy
+from narrow specialization and from an obscurantist faith in the expert's
+special skill, and in his personal knowledge and authority; a faith that so
+well fits our `post-rationalist' and `post-critical' age, proudly dedicated
+to the destruction of the tradition of rational philosophy, and of rational
+thought itself.
 @author Karl Popper. The logic of scientific discovery. 1959.
 @end quotation
 
@@ -795,7 +795,7 @@ mis-understandings about what it really does behind the 
scenes and can
 be misleading. This attitude is further encouraged through non-free
 software@footnote{@url{https://www.gnu.org/philosophy/free-sw.html}}.
 This approach to scientific software only helps in producing dogmas
-and an ``obscurantist faith in the expert’s special skill, and in his
+and an ``obscurantist faith in the expert's special skill, and in his
 personal knowledge and authority''@footnote{Karl Popper. The logic of
 scientific discovery. 1959. Larger quote is given at the start of the
 PDF (for print) version of this book.}.
@@ -2607,18 +2607,25 @@ take effect.
 @cindex GNU Libtool
 GNU Libtool is a program to simplify managing of the libraries to build an
 executable (program). It is used by @ref{BuildProgram} in Gnuastro to help
-you easily link to all the necessary libraries that Gnuastro's library
-depends on. Libtool is a low-level program that is probably already present
-on your system (and in your operating system package manager). However, if
-you want to install it's latest version from source, please visit its
+you when you are writing your own C code. It will enable easy linking to
+all the necessary libraries that Gnuastro's library depends on. If GNU
+Libtool isn't present on your system, then BuildProgram won't be built or
+installed. The configure script will look for GNU Libtool through the
+following executable names in your search path @command{libtool} (if it is
+GNU's implementation) or @command{glibtool}.
+
+Libtool is a low-level program that is probably already present on your
+system (and in your operating system package manager). However, if you want
+to install it's latest version from source, please visit its
 @url{https://www.gnu.org/software/libtool/, webpage}.
 
-Gnuastro's tarball ships with Libtool and it is extensively used during its
-building and installing. Therefore, you can easily build Gnuastro even if
-you don't have Libtool installed on your system. However, this internal
-Libtool does not get installed. Hence, if you want to use the installed
-BuildProgram to compile and link your own source code later, you need to
-have Libtool on your system (independent of Gnuastro).
+Gnuastro's tarball ships with an internal implementation of GNU Libtool and
+it is extensively used while Gnuastro is being built and
+installed. Therefore, you can still build Gnuastro even if you don't have
+GNU Libtool installed on your system. However, this internal Libtool does
+not get installed. Hence, if you want to use BuildProgram to compile and
+link your own C source code later, you need to have GNU Libtool available
+on your system (independent of Gnuastro).
 
 @item libgit2
 @cindex Git
@@ -3024,7 +3031,7 @@ telling it to copy some files (instead of making symbolic 
links, with the
 @option{--copy} option, this is not mandatory@footnote{The @option{--copy}
 option is recommended because some backup systems might do strange things
 with symbolic links.}) and where to look for Gnulib (with the
-@option{--gnulib-srcdir} option). Please note that teh address given to
+@option{--gnulib-srcdir} option). Please note that the address given to
 @option{--gnulib-srcdir} has to be an absolute address (so don't use
 @file{~} or @file{../} for example).
 
@@ -4270,7 +4277,7 @@ the whole string you want to pass to @option{--hdu} as 
seen below:
 @example
 $ astcrop --hdu="3; images(exposure > 100)" FITSimage.fits
 @end example
-Alternatively you can put a `@command{\}' before every metacharacter in
+Alternatively you can put a `@command{\}' before every meta-character in
 this string, but try doing that, and probably you will agree that the
 double quotes are much more easier, elegant and readable.
 
@@ -4656,8 +4663,8 @@ see @ref{Report a bug}.
 @itemx --tilesize=[,INT[,...]]
 The size of regular tiles for tessellation, see @ref{Tessellation}. For
 each dimension an integer length (in units of data-elements or pixels) is
-necessary. If the input dimensionality is different from the number of
-values given to this option, the program will stop with an error. Values
+necessary. If the number of input dimensions is different from the number
+of values given to this option, the program will stop with an error. Values
 must be separated by commas (@key{,}) and can also be fractions (for
 example @code{4/2}). If they are fractions, the result must be an integer,
 otherwise an error will be printed.
@@ -8704,10 +8711,9 @@ moving average}) on the input dataset. During mean 
filtering, each pixel
 (excluding blank values). The number of surrounding pixels in each
 dimension (to calculate the mean) is determined through the earlier
 operands that have been pushed onto the stack prior to the input
-dataset. The number of necessary operands is determined by the
-dimensionality of the input dataset (first popped operand). The order of
-the dimensions on the command-line is the order in FITS format. Here is one
-example:
+dataset. The number of necessary operands is determined by the dimensions
+of the input dataset (first popped operand). The order of the dimensions on
+the command-line is the order in FITS format. Here is one example:
 
 @example
 $ astarithmetic 5 4 image.fits filter-mean
@@ -12323,7 +12329,7 @@ Removed options:
 @item
 @option{--dilate}: In the paper, true detections were dilated for a final
 dig into the noise. However, simple 8-connected dilation can produce boxy
-results which are not realistic and could miss diffuse flux. The finalq dig
+results which are not realistic and could miss diffuse flux. The final dig
 into the noise is now done by ``grow''ing the true detections, similar to
 how true clumps were grown, see the description of @option{--detgrowquant}
 below and in @ref{Detection options} for more on the new alternative.
@@ -12760,7 +12766,7 @@ will be ignored. When there is more than one channel 
(and
 will be done on each channel independently.
 
 This option is useful when a large and diffuse (almost flat within each
-tile) signal exists with very small regions of Sky. The flat-ness of the
+tile) signal exists with very small regions of Sky. The flatness of the
 profile will cause it to successfully pass the tests of @ref{Quantifying
 signal in a tile}. As a result, without this option the flat and diffuse
 signal will be interpretted as sky. In such cases, you can see the status
@@ -15914,8 +15920,8 @@ dimensions, for example @code{CRPIX1} and @code{PC2_1}. 
You can see the
 FITS headers with Gnuastro's @ref{Fits} program using a command like this:
 @command{$ astfits -p image.fits}.
 
-If the values given to all of these options does not correspond to the
-dimensionality of the output dataset, then no WCS information will be
+If the values given to any of these options does not correspond to the
+number of dimensions in the output dataset, then no WCS information will be
 added.
 
 @table @option
@@ -16433,7 +16439,7 @@ interested readers can study those books.
 @subsection Distance on a 2D curved space
 
 The observations to date (for example the Planck 2015 results), have not
-measured@footnote{The observations are interpeted under the assumption of
+measured@footnote{The observations are interpreted under the assumption of
 uniform curvature. For a relativistic alternative to dark energy (and maybe
 also some part of dark matter), non-uniform curvature may be even be more
 critical, but that is beyond the scope of this brief explanation.} the
@@ -16469,7 +16475,7 @@ parametrize this space is through the Cartesian 
coordinates (@mymath{x},
 are plotted. An infinitesimal change in the direction of each axis is
 written as @mymath{dx} and @mymath{dy}. For each point, the infinitesimal
 changes are parallel with the respective axes and are not shown for
-clarity. Another very useful way of parametrizing this space is through
+clarity. Another very useful way of parameterizing this space is through
 polar coordinates. For each point, we define a radius (@mymath{r}) and
 angle (@mymath{\phi}) from a fixed (but arbitrary) reference axis. In
 @ref{flatplane} the infinitesimal changes for each polar coordinate are
@@ -16568,7 +16574,7 @@ have a finite universe, where @mymath{r} cannot become 
larger than
 @mymath{R} as in @ref{sphereandplane}. When @mymath{K=0}, we have a flat
 plane (@ref{flatplane}) and a negative @mymath{K} will correspond to an
 imaginary @mymath{R}. The latter two cases may be infinite in area (which
-is not a simple concept, but mathematically can be modelled with @mymath{r}
+is not a simple concept, but mathematically can be modeled with @mymath{r}
 extending infinitely), or finite-area (like a cylinder is flat everywhere
 with @mymath{ds_s^2={dx^2 + dy^2}}, but finite in one direction in size).
 
@@ -16619,12 +16625,12 @@ can include a multiplicative scaling factor, which is 
a function of time:
 cosmology, the physics we assume for it: general relativity, and the choice
 of whether the universe is uniform (`homogeneous') in density and curvature
 or inhomogeneous. In this section, the functional form of @mymath{a(t)} is
-irrelevant, so we can aviod these issues.
+irrelevant, so we can avoid these issues.
 
 With this scaling factor, the proper distance will also depend on time. As
 the universe expands, the distance between two given points will shift to
 larger values. We thus define a distance measure, or coordinate, that is
-independent of time and thus doesn’t `move'. We call it the @emph{comoving
+independent of time and thus doesn't `move'. We call it the @emph{comoving
 distance} and display with @mymath{\chi} such that:
 @mymath{l(r,t)=\chi(r)a(t)}.  We have therefore, shifted the @mymath{r}
 dependence of the proper distance we derived above for a static universe to
@@ -16641,9 +16647,9 @@ the object can be scaled with @mymath{a(t)}.
 
 Measuring the change of distance in a time-dependent (expanding) universe
 only makes sense if we can add up space and time@footnote{In other words,
-making our spacetime consistent with Minkowski spacetime geometry. In this
-geometry, different observers at a given point (event) in spacetime split
-up spacetime into `space' and `time' in different ways, just like people at
+making our space-time consistent with Minkowski space-time geometry. In this
+geometry, different observers at a given point (event) in space-time split
+up space-time into `space' and `time' in different ways, just like people at
 the same spatial position can make different choices of splitting up a map
 into `left--right' and `up--down'. This model is well supported by
 twentieth and twenty-first century observations.}. But we can only add bits
@@ -16652,10 +16658,10 @@ conversion constant (similar to how 1000 is used to 
convert a kilometer
 into meters).  Experimentally, we find strong support for the hypothesis
 that this conversion constant is the speed of light (or gravitational
 waves@footnote{The speed of gravitational waves was recently found to be
-very similar to that of light in vaccum, see
+very similar to that of light in vacuum, see
 @url{https://arxiv.org/abs/1710.05834, arXiv:1710.05834}.}) in a
 vacuum. This speed is postulated to be constant@footnote{In @emph{natural
-units}, speed is measured in units of the speed of light in vaccum.} and is
+units}, speed is measured in units of the speed of light in vacuum.} and is
 almost always written as @mymath{c}. We can thus parametrize the change in
 distance on an expanding 2D surface as
 
@@ -16912,7 +16918,7 @@ The conversion factor (addition) to absolute magnitude. 
Note that this is
 practically the distance modulus added with @mymath{-2.5\log{(1+z)}} for
 the the desired redshift based on the input parameters. Once the apparent
 magnitude and redshift of an object is known, this value may be added with
-the apparent magnitdue to give the object's absolute magnitude.
+the apparent magnitude to give the object's absolute magnitude.
 
 @item -g
 @itemx --age
@@ -17553,6 +17559,14 @@ Gnuastro's prerequisite libraries change or other 
libraries are added, you
 don't have to worry, you can just run BuildProgram and internal linking
 will be done correctly.
 
+@cartouche
+@noindent
+@strong{BuildProgram requires GNU Libtool:} BuildProgram depends on GNU
+Libtool, therefore if GNU Libtool isn't available at Gnuastro's configure
+time, BuildProgram will not be built or installed. Please see @ref{Optional
+dependencies} for more information.
+@end cartouche
+
 @menu
 * Invoking astbuildprog::       Options and examples for using this program.
 @end menu
@@ -17710,7 +17724,7 @@ and the actual binary/compiled file is not of later use.
 @itemx --la=STR
 Use the given @file{.la} file (Libtool control file) instead of the one
 that was produced from Gnuastro's configuration results. The Libtool
-control file keeps all the necesary information for building and linking a
+control file keeps all the necessary information for building and linking a
 program with a library built by Libtool. The default
 @file{prefix/lib/libgnuastro.la} keeps all the information necessary to
 build a program using the Gnuastro library gathered during configure time
@@ -21392,7 +21406,7 @@ only parse it from start to end.
 @item withblank
 If the block containing the tiles has blank elements, those blank elements
 will be blank in the output of this function also, hence the array will be
-initialzied with blank values when this option is called (see below).
+initialized with blank values when this option is called (see below).
 
 @item initialize
 Initialize the allocated space with blank values before writing in the
@@ -22764,7 +22778,7 @@ Return the distance modulus at redshift @code{z} (with 
no units).
 @end deftypefun
 
 @deftypefun double gal_cosmology_to_absolute_mag (double @code{z}, double 
@code{H0}, double @code{o_lambda_0}, double @code{o_matter_0}, double 
@code{o_radiation_0})
-Return the conversion from apparent to absolute magnitdue for an object at
+Return the conversion from apparent to absolute magnitude for an object at
 redshift @code{z}. This value has to be added to the apparent magnitude to
 give the absolute magnitude of an object at redshift @code{z}.
 @end deftypefun
diff --git a/lib/gnuastro/dimension.h b/lib/gnuastro/dimension.h
index 314891e..4d81db0 100644
--- a/lib/gnuastro/dimension.h
+++ b/lib/gnuastro/dimension.h
@@ -188,6 +188,12 @@ gal_dimension_dist_manhattan(size_t *a, size_t *b, size_t 
ndim);
     size_t nind, gdn_ind=index;                                         \
     uint8_t gdn_D, *gdn_is_start, *gdn_is_end, *gdn_is_edge, gdn_one=1; \
                                                                         \
+    /* A small sanity check. */                                         \
+    if(connectivity>ndim)                                               \
+      error(EXIT_FAILURE, 0, "%s: connectivity value (%d) is larger "   \
+            "than the number of dimensions (%zu)", __func__,            \
+            (int)connectivity, ndim);                                   \
+                                                                        \
     /* Initialize the start/end. */                                     \
     gdn_is_start=(uint8_t *)(&gdn_bitstr);                              \
     gdn_is_end=(uint8_t *)(&gdn_bitstr)+1;                              \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2285ee2..da998b1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -48,8 +48,8 @@ endif
 if COND_HASLIBJPEG
   MAYBE_HASLIBJPEG = "yes"
 endif
-if COND_HASLIBTOOL
-  MAYBE_HASLIBTOOL = "yes"
+if COND_HASGNULIBTOOL
+  MAYBE_HASGNULIBTOOL = "yes"
 endif
 if COND_ARITHMETIC
   MAYBE_ARITHMETIC_TESTS = arithmetic/snimage.sh arithmetic/onlynumbers.sh \
@@ -196,7 +196,7 @@ AM_TESTS_ENVIRONMENT =                              \
 export mkdir_p="$(MKDIR_P)";                        \
 export topsrc=$(top_srcdir);                        \
 export haslibjpeg=$(MAYBE_HASLIBJPEG);              \
-export haslibtool=$(MAYBE_HASLIBTOOL);              \
+export hasgnulibtool=$(MAYBE_HASGNULIBTOOL);        \
 export hasghostscript=$(MAYBE_HASGHOSTSCRIPT);
 
 
diff --git a/tests/buildprog/simpleio.sh b/tests/buildprog/simpleio.sh
index 6fa9e83..499a56d 100755
--- a/tests/buildprog/simpleio.sh
+++ b/tests/buildprog/simpleio.sh
@@ -49,7 +49,10 @@ source=$topsrc/tests/$prog/simpleio.c
 if [ ! -f $execname ]; then echo "$execname not created.";  exit 77; fi
 if [ ! -f $img      ]; then echo "$img does not exist.";    exit 77; fi
 if [ ! -f $source   ]; then echo "$source does not exist."; exit 77; fi
-if [ "x$haslibtool" != "xyes" ];then echo "libtool not present.";  exit 77;fi
+if [ "x$hasgnulibtool" != "xyes" ];then
+    echo "GNU libtool not present.";
+    exit 77;
+fi
 
 
 



reply via email to

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