[GRASS-SVN] r33720 - grass/trunk/imagery/i.atcorr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 7 06:51:12 EDT 2008


Author: pkelly
Date: 2008-10-07 06:51:12 -0400 (Tue, 07 Oct 2008)
New Revision: 33720

Modified:
   grass/trunk/imagery/i.atcorr/main.cpp
Log:
Remove isnan() and use G_is_f_null_value()


Modified: grass/trunk/imagery/i.atcorr/main.cpp
===================================================================
--- grass/trunk/imagery/i.atcorr/main.cpp	2008-10-07 10:42:20 UTC (rev 33719)
+++ grass/trunk/imagery/i.atcorr/main.cpp	2008-10-07 10:51:12 UTC (rev 33720)
@@ -25,7 +25,6 @@
 ***************************************************************************/
 
 #include <cstdlib>
-#include <cmath>
 #include <map>
 
 extern "C" {
@@ -305,8 +304,13 @@
         /* loop over all the values in the row */
 	for(col = 0; col < G_window_cols(); col++)
 	{
-/* TODO: use G_set_f_null_value()?? */
-	    if(vis && isnan(vis[col]) || alt && isnan(alt[col]) || isnan(buf[col])) {buf[col] = FP_NAN; continue;}
+	    if(vis && G_is_f_null_value(&vis[col]) || 
+	       alt && G_is_f_null_value(&alt[col]) || 
+	              G_is_f_null_value(&buf[col]))
+	    {
+	        G_set_f_null_value(&buf[col], 1);
+	        continue;
+	    }
 	    alt[col] /= 1000.0f; /* converting to km from input which should be in meter */
 
             /* check if both maps are active and if whether any value has changed */



More information about the grass-commit mailing list