gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 4a7b934d: Book: added box under the + operator


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 4a7b934d: Book: added box under the + operator for cases that involve NaNs
Date: Sat, 3 Dec 2022 18:04:32 -0500 (EST)

branch: master
commit 4a7b934dd8aa53bc0d3854a31ce04988bd6be327
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Book: added box under the + operator for cases that involve NaNs
    
    Until now, the description of the '+' operator didn't mention how it treats
    NaN values.
    
    With this commit, a box has been added at the end of the description of the
    '+' operator that describes the problem and solution (to use the 'sum'
    operator of the stacking operators).
    
    This issue was raised by Elham Saremi, and before this by Giulia Golini and
    Raul Infante-Sainz.
---
 doc/gnuastro.texi | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index a6d92040..8d41907b 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -16473,7 +16473,23 @@ $ astarithmetic a.fits b.fits + c.fits + -osum.fits
 $ astarithmetic a.fits b.fits c.fits + + -osum.fits
 @end example
 
-However, this can get annoying/buggy if you have more than three or four 
images, in that case, a better way to sum data is to use the @code{sum} 
operator (which also ignores blank pixels), that is discussed below.
+However, this can get annoying/buggy if you have more than three or four 
images, in that case, a better way to sum data is to use the @code{sum} 
operator (which also ignores blank pixels), that is discussed in @ref{Stacking 
operators}.
+
+@cartouche
+@noindent
+@strong{NaN values:} if a single argument of @code{+} has a NaN value, the 
output will also be NaN.
+To ignore NaN values, use the @code{sum} operator of @ref{Stacking operators}.
+You can see the difference with the two commands below:
+
+@example
+$ astarithmetic --quiet 1.0 2.0 3.0 nan + + +
+nan
+$ astarithmetic --quiet 1.0 2.0 3.0 nan 4 sum
+6.000000e+00
+@end example
+
+The same goes for all the @ref{Stacking operators} so if your data may include 
NaN pixels, be sure to use the stacking operators.
+@end cartouche
 
 @item -
 Subtraction, so ``@command{4 5 -}'' is equivalent to @mymath{4-5}.



reply via email to

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