gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 43f51fa6: PSF-stamp: normalization value fixed


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 43f51fa6: PSF-stamp: normalization value fixed to float32
Date: Sun, 13 Feb 2022 05:35:57 -0500 (EST)

branch: master
commit 43f51fa6dbc722ec20423e81d8214ac182c4f0b4
Author: Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    PSF-stamp: normalization value fixed to float32
    
    Until now, the numerical type of the stamp images could be different for
    stamps generated by the same image! This was because the type of the
    normalization value are interpretted from the number of digits they
    have. This could cause problems later when we stack the images. The issue
    (with examples) is fully described in the comments that have been added to
    the scipt as part of this commit.
    
    With this commit, at first the type of the normalization value is changed
    to the 'float32' and then images are normalized with this simillar type of
    normalization values. Finally the type of the stamp images will be same and
    we can easily by using the 'astarithmetic' stack all of the stamp images
    together.
---
 bin/script/psf-create-make-stamp.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/script/psf-create-make-stamp.in 
b/bin/script/psf-create-make-stamp.in
index 3cf8fe8a..21d95e49 100644
--- a/bin/script/psf-create-make-stamp.in
+++ b/bin/script/psf-create-make-stamp.in
@@ -555,8 +555,15 @@ fi
 # Normalize the stamp
 # -------------------
 #
-# Normalize the masked stamp by dividing by the normalization value.
-astarithmetic $cropped_masked --hdu=1 $normvalue / --output=$output $quiet
+# Before applying the normalization factor to the masked stamps, we should
+# make sure the the normalization value has a 'float32' type. This is
+# because Arithmetic will interpret its type based on the number of digits
+# it has. Therefore something like 1.7204 will be read as float32 (1.7204),
+# but 1.868915 will be read as 'float64'. In the latter case, the output
+# will become 'float64' also, which will cause problems later when we want
+# to stack them together (some images will be 'float32', some 'float64').
+astarithmetic $cropped_masked --hdu=1 $normvalue float32 / \
+              --output=$output $quiet
 
 
 



reply via email to

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