gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 38249a86: psf-stamp and psf-scale-factor: corr


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 38249a86: psf-stamp and psf-scale-factor: corrected comment above changed code
Date: Tue, 28 Jun 2022 05:59:35 -0400 (EDT)

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

    psf-stamp and psf-scale-factor: corrected comment above changed code
    
    Until now, the comments for the part where we read the clump and object
    labels in these two scripts mentioned that the labels are written to a
    file. However, since the last commit, that is no longer the case and labels
    are just read into memory.
    
    With this commit, those two comments have been removed to avoid
    confusion. However, having the clump and object labels can be useful in
    debugging, so with this commit, if the script isn't in '--quiet' mode, it
    will print the clump and object labels it found to the standard output.
    
    This was pointed out by Raul Infante-Sainz.
---
 bin/script/psf-scale-factor.in | 8 ++++++--
 bin/script/psf-stamp.in        | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/bin/script/psf-scale-factor.in b/bin/script/psf-scale-factor.in
index f7c5d6f1..d6c97700 100644
--- a/bin/script/psf-scale-factor.in
+++ b/bin/script/psf-scale-factor.in
@@ -527,8 +527,7 @@ astcrop $inputs --hdu=$hdu --mode=img \
 #   - Mask all non zero pixels in the mask image as nan values.
 if [ x"$segment" != x ]; then
 
-    # Find the object and clump labels of the target. Labels are saved into
-    # plain text files just in case they are necessary for debugging tasks.
+    # Find the object and clump labels of the target.
     clab=$(astcrop $segment --hdu=CLUMPS --mode=img --width=1,1 \
                    --oneelemstdout --center=$xcenter,$ycenter \
                    --quiet)
@@ -548,6 +547,11 @@ EOF
         fi
         cropped_masked=$cropped
     else
+        # To help in debugging (when '--quiet' is not called)
+        if [ x"$quiet" = x ]; then
+            echo "$segment: at $center, found clump $clab in object $olab"
+        fi
+
         # Crop the object and clump image to same size as desired stamp.
         cropclp=$tmpdir/cropped-clumps-$objectid.fits
         cropobj=$tmpdir/cropped-objects-$objectid.fits
diff --git a/bin/script/psf-stamp.in b/bin/script/psf-stamp.in
index ded12594..4f078490 100644
--- a/bin/script/psf-stamp.in
+++ b/bin/script/psf-stamp.in
@@ -584,8 +584,7 @@ fi
 #   - Mask all non zero pixels in the mask image as nan values.
 if [ x"$segment" != x ]; then
 
-    # Find the object and clump labels of the target. Labels are saved into
-    # plain text files just in case they are necessary for debugging tasks.
+    # Find the object and clump labels of the target.
     clab=$(astcrop $segment --hdu=CLUMPS --mode=img --width=1,1 \
                    --oneelemstdout --center=$xcenter,$ycenter \
                    --quiet)
@@ -604,6 +603,11 @@ EOF
         cropped_masked=$cropped
 
     else
+        # To help in debugging (when '--quiet' is not called)
+        if [ x"$quiet" = x ]; then
+            echo "$segment: at $center, found clump $clab in object $olab"
+        fi
+
         # Crop the object and clump image to same size as desired stamp.
         cropclp=$tmpdir/cropped-clumps-$objectid.fits
         cropobj=$tmpdir/cropped-objects-$objectid.fits



reply via email to

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