gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 521daec6: New installed scripts: man-pages add


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 521daec6: New installed scripts: man-pages added, lintian warnings addressed
Date: Thu, 17 Mar 2022 19:15:59 -0400 (EDT)

branch: master
commit 521daec6857305c68434fe6a7d4147a14bf21556
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    New installed scripts: man-pages added, lintian warnings addressed
    
    Until now, no man-page was constructed for the newly added installed
    scripts since version 0.16! There were also a few other Bash-specific
    features in some of the scripts (like using 'type' and the definition of a
    function (where the parenthesis should touch). All of these were found
    while test-packaging Gnuastro in Debian prior to the version 0.17 release:
    Debian's Lintian found and reported these issues.
    
    With this commit, all the issues have been addressed: the rules to create
    man-pages for the new installed scripts have been added, and the non-POSIX
    issues were also fixed in the scripts.
    
    This commit includes the following two minor corrections also:
    
     - I noticed a compiler warning for un-initialized variables in Table
       during the build on Debian. So they are corrected.
    
     - The new Lintian is warning long lines and in particular three very long
       lines (sentences!) in the book (which included a multi-line
       footnote). Those long lines have therefore been broken into smaller
       sentances. This helps remove this warning, and also makes the text
       easier to read.
    
     - The word 'function' in the error message of a shell function caused a
       false warning by Lintian, so they have been removed.
---
 bin/script/fits-view.in        |  2 +-
 bin/script/psf-scale-factor.in |  6 ++++--
 bin/script/psf-stamp.in        |  7 ++++---
 bin/table/arithmetic.c         |  2 +-
 doc/Makefile.am                | 35 ++++++++++++++++++++++++++++++++++-
 doc/gnuastro.texi              | 15 ++++++++++++---
 6 files changed, 56 insertions(+), 11 deletions(-)

diff --git a/bin/script/fits-view.in b/bin/script/fits-view.in
index b7bc0e4e..43ca333e 100755
--- a/bin/script/fits-view.in
+++ b/bin/script/fits-view.in
@@ -280,7 +280,7 @@ fi
 # won't set this option at all and let DS9 use its default size.
 ds9geoopt=""
 if [ x"$ds9geometry" = x ]; then
-    if type xrandr > /dev/null 2>/dev/null; then
+    if command -v xrandr > /dev/null 2>/dev/null; then
 
         # The line with a '*' is the resolution of the used screen. We will
         # then extract the height (second value) and set DS9's geometry
diff --git a/bin/script/psf-scale-factor.in b/bin/script/psf-scale-factor.in
index fc730e62..ea41307f 100644
--- a/bin/script/psf-scale-factor.in
+++ b/bin/script/psf-scale-factor.in
@@ -438,7 +438,8 @@ astcrop $inputs --hdu=$hdu --mode=img \
 #
 # Given a certain extension ('CLUMPS' or 'OBJECTS'), find the respective
 # label.
-find_central_label () {
+find_central_label() {
+
   # Input arguments
   hdu=$1
 
@@ -447,8 +448,9 @@ find_central_label () {
       CLUMPS) labname=clump;;
       OBJECTS) labname=object;;
       *) cat <<EOF
-$scriptname: ERROR: a bug! Please contact us at bug-gnuastro@gnu.org to fix 
the problem. The first argument to 'find_central_label' function is not 
'CLUMPS' or 'OBJECTS'
+$scriptname: ERROR: a bug! Please contact us at bug-gnuastro@gnu.org to fix 
the problem. The first argument to 'find_central_label' is not 'CLUMPS' or 
'OBJECTS'
 EOF
+         exit 1
       ;;
   esac
 
diff --git a/bin/script/psf-stamp.in b/bin/script/psf-stamp.in
index 55002d12..e0146e48 100644
--- a/bin/script/psf-stamp.in
+++ b/bin/script/psf-stamp.in
@@ -440,7 +440,8 @@ astcrop $inputs --hdu=$hdu --mode=img \
 #
 # Given a certain extension ('CLUMPS' or 'OBJECTS'), find the respective
 # label.
-find_central_label () {
+find_central_label() {
+
   # Input arguments
   hdu=$1
 
@@ -449,9 +450,9 @@ find_central_label () {
       CLUMPS) labname=clump;;
       OBJECTS) labname=object;;
       *) cat <<EOF
-$scriptname: ERROR: a bug! Please contact us at bug-gnuastro@gnu.org to fix 
the problem. The first argument to 'find_central_label' function is not 
'CLUMPS' or 'OBJECTS'
+$scriptname: ERROR: a bug! Please contact us at bug-gnuastro@gnu.org to fix 
the problem. The first argument to 'find_central_label' is not 'CLUMPS' or 
'OBJECTS'
 EOF
-      ;;
+         exit 1;;
   esac
 
   # Crop the labeled image.
diff --git a/bin/table/arithmetic.c b/bin/table/arithmetic.c
index f271c779..e2af7753 100644
--- a/bin/table/arithmetic.c
+++ b/bin/table/arithmetic.c
@@ -654,7 +654,7 @@ arithmetic_datetosec(struct tableparams *p, gal_data_t 
**stack,
   gal_data_t *out;
   double subsec=NAN;
   char *subsecstr=NULL;
-  char *unit, *name, *comment;
+  char *unit=NULL, *name=NULL, *comment=NULL;
 
   /* Input dataset. */
   gal_data_t *in=arithmetic_stack_pop(stack, operator, NULL);
diff --git a/doc/Makefile.am b/doc/Makefile.am
index b73f0f41..9617f547 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -153,7 +153,10 @@ dist_man_MANS = $(MAYBE_ARITHMETIC_MAN) 
$(MAYBE_BUILDPROG_MAN) \
   $(MAYBE_MKCATALOG_MAN) $(MAYBE_MKNOISE_MAN) $(MAYBE_MKPROF_MAN) \
   $(MAYBE_NOISECHISEL_MAN) $(MAYBE_QUERY_MAN) $(MAYBE_SEGMENT_MAN) \
   $(MAYBE_STATISTICS_MAN) $(MAYBE_TABLE_MAN) $(MAYBE_WARP_MAN) \
-  man/astscript-ds9-region.1 man/astscript-radial-profile.1 \
+  man/astscript-ds9-region.1 man/astscript-fits-view.1 \
+  man/astscript-psf-scale-factor.1 man/astscript-psf-select-stars.1 \
+  man/astscript-psf-stamp.1 man/astscript-psf-subtract.1 \
+  man/astscript-psf-unite.1 man/astscript-radial-profile.1 \
   man/astscript-sort-by-night.1
 
 
@@ -255,6 +258,36 @@ man/astscript-ds9-region.1: 
$(top_srcdir)/bin/script/ds9-region.in   \
        $(MAYBE_HELP2MAN) -n "Create an SAO DS9 region file from a table" \
                          --libtool $(toputildir)/script/astscript-ds9-region
 
+man/astscript-fits-view.1: $(top_srcdir)/bin/script/fits-view.in   \
+                            $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "View FITS images in DS9 and tables in TOPCAT 
based on contents" \
+                         --libtool $(toputildir)/script/astscript-fits-view
+
+man/astscript-psf-scale-factor.1: $(top_srcdir)/bin/script/psf-scale-factor.in 
\
+                                  $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "Find factor to scale PSF to a given star in an 
image" \
+                         --libtool 
$(toputildir)/script/astscript-psf-scale-factor
+
+man/astscript-psf-select-stars.1: $(top_srcdir)/bin/script/psf-select-stars.in 
\
+                                  $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "Select good stars for constructing the PSF" \
+                         --libtool 
$(toputildir)/script/astscript-psf-select-stars
+
+man/astscript-psf-stamp.1: $(top_srcdir)/bin/script/psf-stamp.in \
+                           $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "Make normalized stamp of star with background 
objects masked" \
+                         --libtool $(toputildir)/script/astscript-psf-stamp
+
+man/astscript-psf-subtract.1: $(top_srcdir)/bin/script/psf-subtract.in \
+                              $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "Subtract a given PSF model from the image of 
star" \
+                         --libtool $(toputildir)/script/astscript-psf-subtract
+
+man/astscript-psf-unite.1: $(top_srcdir)/bin/script/psf-unite.in \
+                           $(ALLMANSDEP)
+       $(MAYBE_HELP2MAN) -n "Unite the outer and inner regions of the PSF into 
one" \
+                         --libtool $(toputildir)/script/astscript-psf-unite
+
 man/astscript-radial-profile.1: $(top_srcdir)/bin/script/radial-profile.in   \
                                 $(ALLMANSDEP)
        $(MAYBE_HELP2MAN) -n "Create a radial profile of an object in an image" 
\
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 08a6f580..f635572d 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -4680,7 +4680,9 @@ $ ds9 -mecube r_detected.fits -zscale -cmap sls -zoom to 
fit
 @end example
 
 When looking at the raw input image (which is very ``shallow'': less than a 
minute exposure!), you don't see anything so far out of the galaxy.
-You might just think to yourself that ``this is all noise, I have just dug too 
deep and I'm following systematics''! If you feel like this, have a look at 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_exposu [...]
+You might just think to yourself that ``this is all noise, I have just dug too 
deep and I'm following systematics''!
+If you feel like this, have a look at 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/}}.
 In these deeper images you clearly see how the outer edges of the M51 group 
follow this exact structure, below in @ref{Achieved surface brightness level}, 
we'll measure the exact level.
 
 As the gradient in the @code{SKY} extension shows, and the deep images cited 
above confirm, the galaxy's signal extends even beyond this.
@@ -7704,7 +7706,10 @@ $ ./configure LDFLAGS=-L/home/name/.local/lib            
\
 
 It can be annoying/buggy to do this when configuring every software that 
depends on such libraries.
 Hence, you can define these two variables in the most relevant startup file 
(discussed above).
-The convention on using these variables doesn't include a colon to separate 
values (as @command{PATH}-like variables do), they use white space characters 
and each value is prefixed with a compiler option@footnote{These variables are 
ultimately used as options while building the programs, so every value has be 
an option name followed be a value as discussed in @ref{Options}.}: note the 
@option{-L} and @option{-I} above (see @ref{Options}), for @option{-I} see 
@ref{Headers}, and for @optio [...]
+The convention on using these variables doesn't include a colon to separate 
values (as @command{PATH}-like variables do).
+They use white space characters and each value is prefixed with a compiler 
option@footnote{These variables are ultimately used as options while building 
the programs.
+Therefore every value has be an option name followed be a value as discussed 
in @ref{Options}.}.
+Note the @option{-L} and @option{-I} above (see @ref{Options}), for 
@option{-I} see @ref{Headers}, and for @option{-L}, see @ref{Linking}.
 Therefore we have to keep the value in double quotation signs to keep the 
white space characters and adding the following two lines to the startup file 
of choice:
 
 @example
@@ -7721,7 +7726,11 @@ To use programs that depend on these libraries, you need 
to add @file{~/.local/l
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/name/.local/lib
 @end example
 
-If you also want to access the Info (see @ref{Info}) and man pages (see 
@ref{Man pages}) documentations add @file{~/.local/share/info} and 
@file{~/.local/share/man} to your @command{INFOPATH}@footnote{Info has the 
following convention: ``If the value of @command{INFOPATH} ends with a colon 
[or it isn't defined] ..., the initial list of directories is constructed by 
appending the build-time default to the value of @command{INFOPATH}.'' So when 
installing in a non-standard directory and if [...]
+If you also want to access the Info (see @ref{Info}) and man pages (see 
@ref{Man pages}) documentations add @file{~/.local/share/info} and 
@file{~/.local/share/man} to your @command{INFOPATH}@footnote{Info has the 
following convention: ``If the value of @command{INFOPATH} ends with a colon 
[or it isn't defined] ..., the initial list of directories is constructed by 
appending the build-time default to the value of @command{INFOPATH}.''
+So when installing in a non-standard directory and if @command{INFOPATH} was 
not initially defined, add a colon to the end of @command{INFOPATH} as shown 
below.
+Otherwise Info will not be able to find system-wide installed documentation:
+@*@command{echo 'export INFOPATH=$INFOPATH:/home/name/.local/share/info:' >> 
~/.bashrc}@*
+Note that this is only an internal convention of Info: do not use it for other 
@command{*PATH} variables.} and @command{MANPATH} environment variables 
respectively.
 
 @cindex Search directory order
 @cindex Order in search directory



reply via email to

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