[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 5fdd3a4a 31/69: PSF create: including the make
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 5fdd3a4a 31/69: PSF create: including the make check step for two PSF scripts |
Date: |
Wed, 26 Jan 2022 12:39:12 -0500 (EST) |
branch: master
commit 5fdd3a4a6552335192a4cf955ec4061c3889ac38
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
PSF create: including the make check step for two PSF scripts
Until this commit, the 'make check' step of the scripts related to the
construction of the PSF were not set. With this commit, this step has been
added for two scripts (junction and stamps). Now, during the installation
of Gnuastro they are check in order to ensure eveything is fine.
---
bin/script/Makefile.am | 16 +++++-
tests/Makefile.am | 6 ++-
tests/script/psf-create-junction.sh | 91 +++++++++++++++++++++++++++++++++
tests/script/psf-create-make-stamp.sh | 96 +++++++++++++++++++++++++++++++++++
4 files changed, 206 insertions(+), 3 deletions(-)
diff --git a/bin/script/Makefile.am b/bin/script/Makefile.am
index a64c9f65..4827c817 100644
--- a/bin/script/Makefile.am
+++ b/bin/script/Makefile.am
@@ -28,11 +28,15 @@
## 'make clean').
bin_SCRIPTS = astscript-ds9-region \
astscript-radial-profile \
- astscript-sort-by-night
+ astscript-sort-by-night \
+ astscript-psf-create-junction \
+ astscript-psf-create-make-stamp
EXTRA_DIST = ds9-region.in \
+ sort-by-night.in \
radial-profile.in \
- sort-by-night.in
+ psf-create-junction.in \
+ psf-create-make-stamp.in
CLEANFILES = $(bin_SCRIPTS)
@@ -60,3 +64,11 @@ astscript-radial-profile: radial-profile.in Makefile
astscript-sort-by-night: sort-by-night.in Makefile
$(do_subst) < $(srcdir)/sort-by-night.in > $@
chmod +x $@
+
+astscript-psf-create-junction: psf-create-junction.in Makefile
+ $(do_subst) < $(srcdir)/psf-create-junction.in > $@
+ chmod +x $@
+
+astscript-psf-create-make-stamp: psf-create-make-stamp.in Makefile
+ $(do_subst) < $(srcdir)/psf-create-make-stamp.in > $@
+ chmod +x $@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 83496aad..9d572491 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -207,11 +207,15 @@ endif
# Script tests.
SCRIPT_TESTS = script/sort-by-night.sh \
- script/radial-profile.sh
+ script/radial-profile.sh \
+ script/psf-create-junction.sh \
+ script/psf-create-make-stamp.sh
# We want to have several FITS files as input for this script.
script/sort-by-night.sh: mkcatalog/aperturephot.sh.log
script/radial-profile.sh: mkprof/mosaic2.sh.log
+script/psf-create-junction.sh: mkprof/mosaic2.sh.log
+script/psf-create-make-stamp.sh: mkprof/mosaic2.sh.log
diff --git a/tests/script/psf-create-junction.sh
b/tests/script/psf-create-junction.sh
new file mode 100755
index 00000000..19ce0e4e
--- /dev/null
+++ b/tests/script/psf-create-junction.sh
@@ -0,0 +1,91 @@
+# Generate two stamps from a mock image to test the PSF stamps script
+#
+# See the Tests subsection of the manual for a complete explanation
+# (in the Installing gnuastro section).
+#
+# Original author:
+# Raul Infante-Sainz <infantesainz@gmail.com>
+# Contributing author(s):
+# Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2015-2021, Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+
+
+
+
+# Preliminaries
+# =============
+#
+# Set the variables (the executable is in the build tree). Do the
+# basic checks to see if the executable is made or if the defaults
+# file exists (basicchecks.sh is in the source tree).
+prog=psf-create-junction
+dep1=crop
+dep2=fits
+dep3=warp
+dep4=mkprof
+dep5=arithmetic
+dep1name=../bin/$dep1/ast$dep1
+dep2name=../bin/$dep2/ast$dep2
+dep3name=../bin/$dep3/ast$dep3
+dep4name=../bin/$dep4/ast$dep4
+dep5name=../bin/$dep5/ast$dep5
+execname=../bin/script/astscript-$prog
+fits1name=0_mkprofcat2.fits
+
+
+
+
+
+# Skip?
+# =====
+#
+# If the dependencies of the test don't exist, then skip it. There are two
+# types of dependencies:
+#
+# - The executable script was not made.
+# - The programs it use weren't made.
+# - The input data weren't made.
+if [ ! -f $execname ]; then echo "$execname doesn't exist."; exit 77; fi
+if [ ! -f $dep1name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $dep2name ]; then echo "$dep2name doesn't exist."; exit 77; fi
+if [ ! -f $dep3name ]; then echo "$dep3name doesn't exist."; exit 77; fi
+if [ ! -f $dep4name ]; then echo "$dep4name doesn't exist."; exit 77; fi
+if [ ! -f $dep5name ]; then echo "$dep5name doesn't exist."; exit 77; fi
+if [ ! -f $fits1name ]; then echo "$fits1name doesn't exist."; exit 77; fi
+
+
+
+
+
+
+# Put a link of Gnuastro program(s) used into current directory. Note that
+# other script tests may have already brought it.
+ln -sf $dep1name ast$dep1
+ln -sf $dep2name ast$dep2
+ln -sf $dep3name ast$dep3
+ln -sf $dep4name ast$dep4
+ln -sf $dep5name ast$dep5
+
+
+
+
+
+# Actual test script
+# ==================
+#
+# 'check_with_program' can be something like Valgrind or an empty
+# string. Such programs will execute the command if present and help in
+# debugging when the developer doesn't have access to the user's system.
+#
+# Since we want the script to recognize the programs that it will use from
+# this same build of Gnuastro, we'll add the current directory to PATH.
+export PATH="./:$PATH"
+$check_with_program $execname $fits1name --core=$fits1name \
+ --fluxfactor=3.3 --radius=5
+
diff --git a/tests/script/psf-create-make-stamp.sh
b/tests/script/psf-create-make-stamp.sh
new file mode 100755
index 00000000..2a837bfa
--- /dev/null
+++ b/tests/script/psf-create-make-stamp.sh
@@ -0,0 +1,96 @@
+# Generate two stamps from a mock image to test the PSF stamps script
+#
+# See the Tests subsection of the manual for a complete explanation
+# (in the Installing gnuastro section).
+#
+# Original author:
+# Raul Infante-Sainz <infantesainz@gmail.com>
+# Contributing author(s):
+# Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2015-2021, Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+
+
+
+
+# Preliminaries
+# =============
+#
+# Set the variables (the executable is in the build tree). Do the
+# basic checks to see if the executable is made or if the defaults
+# file exists (basicchecks.sh is in the source tree).
+prog=psf-create-make-stamp
+dep1=crop
+dep2=fits
+dep3=table
+dep4=arithmetic
+dep5=statistics
+dep6=radial-profile
+dep1name=../bin/$dep1/ast$dep1
+dep2name=../bin/$dep2/ast$dep2
+dep3name=../bin/$dep3/ast$dep3
+dep4name=../bin/$dep4/ast$dep4
+dep5name=../bin/$dep5/ast$dep5
+dep6name=../bin/script/astscript-$dep6
+execname=../bin/script/astscript-$prog
+fits1name=0_mkprofcat2.fits
+
+
+
+
+
+# Skip?
+# =====
+#
+# If the dependencies of the test don't exist, then skip it. There are two
+# types of dependencies:
+#
+# - The executable script was not made.
+# - The programs it use weren't made.
+# - The input data weren't made.
+if [ ! -f $execname ]; then echo "$execname doesn't exist."; exit 77; fi
+if [ ! -f $dep1name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $dep2name ]; then echo "$dep2name doesn't exist."; exit 77; fi
+if [ ! -f $dep3name ]; then echo "$dep3name doesn't exist."; exit 77; fi
+if [ ! -f $dep4name ]; then echo "$dep4name doesn't exist."; exit 77; fi
+if [ ! -f $dep5name ]; then echo "$dep5name doesn't exist."; exit 77; fi
+if [ ! -f $dep6name ]; then echo "$dep6name doesn't exist."; exit 77; fi
+if [ ! -f $fits1name ]; then echo "$fits1name doesn't exist."; exit 77; fi
+
+
+
+
+
+
+# Put a link of Gnuastro program(s) used into current directory. Note that
+# other script tests may have already brought it.
+ln -sf $dep1name ast$dep1
+ln -sf $dep2name ast$dep2
+ln -sf $dep3name ast$dep3
+ln -sf $dep4name ast$dep4
+ln -sf $dep5name ast$dep5
+ln -sf $dep6name astscript-$dep6
+
+
+
+
+
+# Actual test script
+# ==================
+#
+# 'check_with_program' can be something like Valgrind or an empty
+# string. Such programs will execute the command if present and help in
+# debugging when the developer doesn't have access to the user's system.
+#
+# Since we want the script to recognize the programs that it will use from
+# this same build of Gnuastro, we'll add the current directory to PATH.
+export PATH="./:$PATH"
+y=$($dep2name $fits1name -h1 | grep 'NAXIS1' | awk '{print $3/2}')
+x=$($dep2name $fits1name -h1 | grep 'NAXIS2' | awk '{print $3/2}')
+$check_with_program $execname $fits1name --center=$x,$y --mode=img
--stampwidth=100,100
+
- [gnuastro-commits] master 117fd766 24/69: PSF select stars: new script for selecting stars, (continued)
- [gnuastro-commits] master 117fd766 24/69: PSF select stars: new script for selecting stars, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 5d9a6d9b 50/69: PSF select-stars: make check steps done again because some new option are added, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 1e0cc1a0 43/69: PSF select-stars: changing default values to not crash in make check, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master ca8fc03a 55/69: PSF scripts: getting proper NAXIS values when data is compressed as .fz, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 5eac0cea 40/69: Book: polishing the description of the PSF select-stars script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master d99fc9df 60/69: PSF select-stars: add new option for selecting more bright stars, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 69a2e6ee 54/69: Book: correct some comments in the psf-create-select-stars, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master f42832f8 23/69: PSF stamp: allowingto use a position angle and axis ratio, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2894b35a 32/69: PSF model: including the make check step for two PSF scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master aae0d156 64/69: PSF tutorial: running of Segment on saturated images added, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 5fdd3a4a 31/69: PSF create: including the make check step for two PSF scripts,
Mohammad Akhlaghi <=
- [gnuastro-commits] master d6e6f9da 47/69: PSF flux-factor: correct the indentation, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 809be22b 67/69: Book: PSF construction tutorial, completed until the outer part, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2b0b6294 56/69: PSF scripts: fixed two FAILS during make checks, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master f2a74d83 30/69: Book: fixing references and labels for the PSF scripts information, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf6335a6 18/69: PSF stamp: enabling the use of sigma-clip parameters, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2718494e 19/69: PSF stamp: allowing to run the script without making normalization, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master da6eea59 33/69: Scripts: changing 'wcstoimg' to 'wcs-to-img' in several scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 50fd424f 66/69: PSF tutorial: adding information to choose proper --normradii values, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap, Mohammad Akhlaghi, 2022/01/26