[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master cd14a366 44/69: PSF select-stars: including th
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master cd14a366 44/69: PSF select-stars: including the make check step for this script |
Date: |
Wed, 26 Jan 2022 12:39:14 -0500 (EST) |
branch: master
commit cd14a366507a1bd5b509cd7e92f3fe8adf6c2386
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
PSF select-stars: including the make check step for this script
Until this commit, the 'make check' step of the script related with the
selection of good stars was not set.
With this commit, this step has been added. Now, during the installation
of Gnuastro this script is checked in order to ensure eveything is fine.
---
bin/script/Makefile.am | 6 +++
tests/Makefile.am | 2 +
tests/script/psf-create-select-stars.sh | 87 +++++++++++++++++++++++++++++++++
3 files changed, 95 insertions(+)
diff --git a/bin/script/Makefile.am b/bin/script/Makefile.am
index 0f8c3c1c..0a82c877 100644
--- a/bin/script/Makefile.am
+++ b/bin/script/Makefile.am
@@ -32,6 +32,7 @@ bin_SCRIPTS = astscript-ds9-region \
astscript-psf-create-junction \
astscript-psf-create-make-stamp \
astscript-psf-model-flux-factor \
+ astscript-psf-create-select-stars \
astscript-psf-model-scattered-light
EXTRA_DIST = ds9-region.in \
@@ -40,6 +41,7 @@ EXTRA_DIST = ds9-region.in \
psf-create-junction.in \
psf-create-make-stamp.in \
psf-model-flux-factor.in \
+ psf-create-select-stars.in \
psf-model-scattered-light.in
CLEANFILES = $(bin_SCRIPTS)
@@ -81,6 +83,10 @@ astscript-psf-model-flux-factor: psf-model-flux-factor.in
Makefile
$(do_subst) < $(srcdir)/psf-model-flux-factor.in > $@
chmod +x $@
+astscript-psf-create-select-stars: psf-create-select-stars.in Makefile
+ $(do_subst) < $(srcdir)/psf-create-select-stars.in > $@
+ chmod +x $@
+
astscript-psf-model-scattered-light: psf-model-scattered-light.in Makefile
$(do_subst) < $(srcdir)/psf-model-scattered-light.in > $@
chmod +x $@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 926ec6f5..cd339ae5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -211,6 +211,7 @@ SCRIPT_TESTS = script/sort-by-night.sh \
script/psf-create-junction.sh \
script/psf-create-make-stamp.sh \
script/psf-model-flux-factor.sh \
+ script/psf-create-select-stars.sh \
script/psf-model-scattered-light.sh
# We want to have several FITS files as input for this script.
@@ -219,6 +220,7 @@ 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
script/psf-model-flux-factor.sh: mkprof/mosaic2.sh.log
+script/psf-model-select-stars.sh: mkprof/mosaic2.sh.log
script/psf-model-scattered-light.sh: mkprof/mosaic2.sh.log
diff --git a/tests/script/psf-create-select-stars.sh
b/tests/script/psf-create-select-stars.sh
new file mode 100755
index 00000000..a5886dbb
--- /dev/null
+++ b/tests/script/psf-create-select-stars.sh
@@ -0,0 +1,87 @@
+# Generate a catalog of stars to test the select-stars PSF 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) 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-select-stars
+dep1=mkcatalog
+dep1name=../bin/$dep1/ast$dep1
+execname=../bin/script/astscript-$prog
+fits1name=convolve_spatial_noised.fits
+fits2name=convolve_spatial_noised_detected_segmented.fits
+fits3name=convolve_spatial_noised_detected_segmented_catalog.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 $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
+
+
+
+
+
+# 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"
+
+# Create a catalog with appropiate parameters
+$check_with_program astmkcatalog $fits2name \
+ --ra --dec --magnitude \
+ --axisratio --output=$fits3name
+
+# Test the script: selecting good stars
+$check_with_program $execname $fits1name --hdu=1 \
+ --segmented=$fits2name \
+ --catalog=$fits3name \
+ --field=magnitude
+
- [gnuastro-commits] master 2b0b6294 56/69: PSF scripts: fixed two FAILS during make checks, (continued)
- [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
- [gnuastro-commits] master cf58a078 62/69: PSF select-stars: give the default value to the two variables, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master db2d55be 37/69: PSF select-stars: changing some variable names to follow conventions, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cd14a366 44/69: PSF select-stars: including the make check step for this script,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 85648ac3 45/69: PSF select-stars: The script has been changed for use in general scenario, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 0facf365 16/69: Book: adding documentation of 'psf-model-scattered-light' script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when centering the different parts of the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 7c398567 36/69: Book: Correct the some parts of the making the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b82adcfc 46/69: Book: some essential option was add to astscript-psf-select-stars section, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master ff3bb03f 38/69: PSF select-stars: removing not used options and polishing the comments, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b5525411 48/69: PSF select-stars: delete the value of some options and ask them from the user, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 075bc680 58/69: PSF select-stars: remove the stars that have stars., Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 9aae5f5c 65/69: Book: Edits to the tutorial on creating the extended PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e2eb54 68/69: Book: Extended PSF tutorial moved to Tutorials chapter, Mohammad Akhlaghi, 2022/01/26