gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master a34ee7b5: astscript-zeropoint: new --mksrc opt


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master a34ee7b5: astscript-zeropoint: new --mksrc option to specify Makefile
Date: Tue, 23 May 2023 13:01:21 -0400 (EDT)

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

    astscript-zeropoint: new --mksrc option to specify Makefile
    
    Until now, when Gnuastro's 'make check' was run on a computer that didn't
    already have Gnuastro 0.20 installed (and thus didn't have the
    'zeropoint.mk' directory in the necessary location!), the zero point
    script's check would fail. This was because we had hard-coded the
    installation directory of the Makefile within the script (to be the
    finally installed location!).
    
    With this commit, a new debugging option has been added to this script
    called '--mksrc'. When this option is given, instead of using the default
    installed Makefile, the script will use the file given to this option. By
    adding this option to the test script for this script, we were able to fix
    the crash mentioned above.
    
    In the process, I also noticed that the order of the installed scripts
    within 'bin/script/Makefile.am' was not alphabetical (making it hard to
    find the script we want). With this commit the rules to prepare the
    installed scripts are alphabetically ordered.
    
    This issue was found with the help of Agata Rożek.
---
 NEWS                         |  5 +++++
 THANKS                       |  1 +
 bin/script/Makefile.am       | 28 ++++++++++++++--------------
 bin/script/zeropoint.in      |  7 ++++---
 doc/announce-acknowledge.txt |  1 +
 doc/gnuastro.texi            |  6 ++++++
 tests/script/zeropoint.sh    |  5 +++--
 7 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/NEWS b/NEWS
index 1a6229cf..8e38dea8 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,11 @@ See the end of the file for license conditions.
     - pool-mean: Similar to 'pool-min' but using mean.
     - pool-median: Similar to 'pool-min' but using median.
 
+  astscript-zeropoint:
+  --mksrc: use a custom Makefile for estimating the zeropoint, not the
+    default installed Makefile. This is primarily intended for debugging or
+    developing this script, not for normal usage.
+
   Library:
   -gal_pool_min: min-pooling function, see 'pool-min' above.
   -gal_pool_max: max-pooling function, see 'pool-min' above.
diff --git a/THANKS b/THANKS
index 01dfdc77..64b4c27f 100644
--- a/THANKS
+++ b/THANKS
@@ -103,6 +103,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Bob Proulx                           bob@proulx.com
     Joseph Putko                         josephputko@gmail.com
     Samane Raji                          samaneraji@gmail.com
+    Agata Rożek                          a.rozek@ed.ac.uk
     Ignacio Ruiz Cejudo                  igruiz04@ucm.es
     Francois Ochsenbein                  francois.ochsenbein@gmail.com
     Teymoor Saifollahi                   teymur.saif@gmail.com
diff --git a/bin/script/Makefile.am b/bin/script/Makefile.am
index ca601af7..6c12f854 100644
--- a/bin/script/Makefile.am
+++ b/bin/script/Makefile.am
@@ -79,24 +79,12 @@ do_subst = sed -e 's,[@]PREFIX[@],$(exec_prefix),g' \
 
 
 ## Rules to install the scripts.
-astscript-fits-view: fits-view.in Makefile
-       $(do_subst) < $(srcdir)/fits-view.in > $@
-       chmod +x $@
-
 astscript-ds9-region: ds9-region.in Makefile
        $(do_subst) < $(srcdir)/ds9-region.in > $@
        chmod +x $@
 
-astscript-zeropoint: zeropoint.in Makefile
-       $(do_subst) < $(srcdir)/zeropoint.in > $@
-       chmod +x $@
-
-astscript-radial-profile: radial-profile.in Makefile
-       $(do_subst) < $(srcdir)/radial-profile.in > $@
-       chmod +x $@
-
-astscript-sort-by-night: sort-by-night.in Makefile
-       $(do_subst) < $(srcdir)/sort-by-night.in > $@
+astscript-fits-view: fits-view.in Makefile
+       $(do_subst) < $(srcdir)/fits-view.in > $@
        chmod +x $@
 
 astscript-psf-unite: psf-unite.in Makefile
@@ -118,3 +106,15 @@ astscript-psf-select-stars: psf-select-stars.in Makefile
 astscript-psf-subtract: psf-subtract.in Makefile
        $(do_subst) < $(srcdir)/psf-subtract.in > $@
        chmod +x $@
+
+astscript-radial-profile: radial-profile.in Makefile
+       $(do_subst) < $(srcdir)/radial-profile.in > $@
+       chmod +x $@
+
+astscript-sort-by-night: sort-by-night.in Makefile
+       $(do_subst) < $(srcdir)/sort-by-night.in > $@
+       chmod +x $@
+
+astscript-zeropoint: zeropoint.in Makefile
+       $(do_subst) < $(srcdir)/zeropoint.in > $@
+       chmod +x $@
diff --git a/bin/script/zeropoint.in b/bin/script/zeropoint.in
index 06b3d601..cc470c43 100644
--- a/bin/script/zeropoint.in
+++ b/bin/script/zeropoint.in
@@ -100,6 +100,7 @@ $scriptname options:
       --starcathdu=STR/INT     HDU of table in '--starcat'.
       --starcatra=STR/INT      Column in '--starcat' that contains RA.
       --starcatdec=STR/INT     Column in '--starcat' that contains DEC.
+      --mksrc=STR              Makefile (for developers when debugging).
 
  Output:
   -o, --output                 Output file name.
@@ -296,6 +297,8 @@ do
         -H|--refimgshdu)         refimgshdu="$2";                              
check_v "$1" "$refimgshdu";  shift;shift;;
         -H=*|--refimgshdu=*)     refimgshdu="${1#*=}";                         
check_v "$1" "$refimgshdu";  shift;;
         -H*)                     refimgshdu=$(echo "$1" | sed -e's/-H//');     
check_v "$1" "$refimgshdu";  shift;;
+        --mksrc)                 mksrc="$2";                                   
check_v "$1" "$mksrc";  shift;shift;;
+        --mksrc=*)               mksrc="${1#*=}";                              
check_v "$1" "$mksrc";  shift;;
 
         # Parameters.
         -M|--magnituderange)     magnituderange="$2";                          
check_v "$1" "$magnituderange";  shift;shift;;
@@ -634,9 +637,7 @@ fi
 
 #
 # Here, Makefile is invoked.
-if [ x$installdir = x ]; then
-    mksrc=zeropoint.mk
-else
+if [ x$mksrc = x ]; then
     mksrc=$installdir/zeropoint.mk
 fi
 make -f $mksrc tmpdir=$tmpdir --jobs=$numthreads
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 75840c43..ccf907e7 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,5 +1,6 @@
 Alphabetically ordered list to acknowledge in the next release.
 
+Agata Rożek
 Irene Pintos Castro
 Raul Infante-Sainz
 Sepideh Eskandarlou
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index f1a3b80a..3ecce2e5 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -31721,6 +31721,12 @@ However, if you would like to keep the intermediate 
files, you can use the @opti
 @itemx --keeptmp
 Its recommended to not remove the temporary directory (see description of 
@option{--keeptmp}).
 This option is useful for debugging and checking the outputs of internal steps.
+
+@item --mksrc=STR
+Use a non-standard Makefile for the Makefile to call.
+This option is primarily useful during the development of this script and its 
Makefile, not for a normal user.
+So if you are not developing this script, you can safely ignore this option.
+When this option is given, the default installed Makefile will not be used: 
the file given to this option will be read by @command{make} (within the 
script) instead.
 @end table
 
 
diff --git a/tests/script/zeropoint.sh b/tests/script/zeropoint.sh
index f12eb753..38a35765 100755
--- a/tests/script/zeropoint.sh
+++ b/tests/script/zeropoint.sh
@@ -84,6 +84,7 @@ $check_with_program $execname \
                     --refcatdec=DEC \
                     --refcat=$intable \
                     --starcat=$intable \
-                    --aperarcsec=0.09,0.13 \
                     --refcatmag=Magnitude \
-                    --output=zeropoint-cat.fits
+                    --aperarcsec=0.09,0.13 \
+                    --output=zeropoint-cat.fits \
+                    --mksrc=$topsrc/bin/script/zeropoint.mk



reply via email to

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