gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 1483201 009/113: Noised cube created in make c


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 1483201 009/113: Noised cube created in make check
Date: Fri, 16 Apr 2021 10:33:31 -0400 (EDT)

branch: master
commit 148320141c19152b86f39aa3152b7355db16fb3a
Author: Mohammad Akhlaghi <akhlaghi@gnu.org>
Commit: Mohammad Akhlaghi <akhlaghi@gnu.org>

    Noised cube created in make check
    
    During `make check', MakeProfiles creates a 3D datacube with three profiles
    (introduced in a previous commit). With this commit noise is added to that
    cube with MakeNoise.
    
    I also noticed that the `tests/mkprof/3dcat.txt' was not added in the Git
    repository (because of its `.txt' prefix). So it is now version controlled
    with this commit.
---
 tests/Makefile.am            |  3 ++-
 tests/mknoise/addnoise-3d.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++
 tests/mkprof/3dcat.txt       |  5 ++++
 3 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index f0ee158..3df0714 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -122,9 +122,10 @@ if COND_MKCATALOG
                              mkprof/clearcanvas.sh.log
 endif
 if COND_MKNOISE
-  MAYBE_MKNOISE_TESTS = mknoise/addnoise.sh
+  MAYBE_MKNOISE_TESTS = mknoise/addnoise.sh mknoise/addnoise-3d.sh
 
   mknoise/addnoise.sh: warp/warp_scale.sh.log
+  mknoise/addnoise-3d.sh: mkprof/3dcat.sh.log
 endif
 if COND_MKPROF
   MAYBE_MKPROF_TESTS = mkprof/mosaic1.sh mkprof/mosaic2.sh         \
diff --git a/tests/mknoise/addnoise-3d.sh b/tests/mknoise/addnoise-3d.sh
new file mode 100755
index 0000000..b04e193
--- /dev/null
+++ b/tests/mknoise/addnoise-3d.sh
@@ -0,0 +1,59 @@
+# Add noise to an input cube.
+#
+# See the Tests subsection of the manual for a complete explanation
+# (in the Installing gnuastro section).
+#
+# Original author:
+#     Mohammad Akhlaghi <akhlaghi@gnu.org>
+# Contributing author(s):
+#
+# 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).
+#
+# We will be adding noise to two images: the warped (smaller) and unwarped
+# (larger) mock images. The warped one will be used by programs that don't
+# care about the size of the image, but the larger one will be used by
+# those that do: for example SubtractSky and NoiseChisel will be better
+# tested on a larger image.
+prog=mknoise
+img=3dcat.fits
+execname=../bin/$prog/ast$prog
+
+
+
+
+
+# Skip?
+# =====
+#
+# If the dependencies of the test don't exist, then skip it. There are two
+# types of dependencies:
+#
+#   - The executable was not made (for example due to a configure option),
+#
+#   - The input data was not made (for example the test that created the
+#     data file failed).
+if [ ! -f $execname ]; then echo "$execname doesn't exist."; exit 77; fi
+if [ ! -f $img      ]; then echo "$img does not exist.";     exit 77; fi
+
+
+
+
+
+# Actual test script
+# ==================
+export GSL_RNG_SEED=1
+export GSL_RNG_TYPE=ranlxs2
+$execname --envseed $img
diff --git a/tests/mkprof/3dcat.txt b/tests/mkprof/3dcat.txt
new file mode 100644
index 0000000..ad54a01
--- /dev/null
+++ b/tests/mkprof/3dcat.txt
@@ -0,0 +1,5 @@
+# Column 5: Profile [name, str8] Profile function.
+#  x   y   z     prof     r    n   p1   p2   p3   q1   q2     m    t
+1  10  5   1    sersic    20   2   45   0    0    0.5  0.25  -16   2
+2  50  50  160  sersic    10   4   20   30   40   1    0.5   -14   2
+3  80  50  80   sersic    30   1   80   50   20   0.4  0.8   -18   2



reply via email to

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