[GRASS-SVN] r33721 - grass/branches/develbranch_6/imagery/i.atcorr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 7 06:53:02 EDT 2008


Author: pkelly
Date: 2008-10-07 06:53:02 -0400 (Tue, 07 Oct 2008)
New Revision: 33721

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


Modified: grass/branches/develbranch_6/imagery/i.atcorr/main.cpp
===================================================================
--- grass/branches/develbranch_6/imagery/i.atcorr/main.cpp	2008-10-07 10:51:12 UTC (rev 33720)
+++ grass/branches/develbranch_6/imagery/i.atcorr/main.cpp	2008-10-07 10:53:02 UTC (rev 33721)
@@ -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