[GRASS-SVN] r31802 - in grass/trunk: imagery/i.cluster lib/imagery

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 22 11:40:38 EDT 2008


Author: neteler
Date: 2008-06-22 11:40:38 -0400 (Sun, 22 Jun 2008)
New Revision: 31802

Modified:
   grass/trunk/imagery/i.cluster/print1.c
   grass/trunk/imagery/i.cluster/print2.c
   grass/trunk/imagery/i.cluster/print3.c
   grass/trunk/lib/imagery/sig.c
Log:
signature file precision enhanced

Modified: grass/trunk/imagery/i.cluster/print1.c
===================================================================
--- grass/trunk/imagery/i.cluster/print1.c	2008-06-22 08:29:10 UTC (rev 31801)
+++ grass/trunk/imagery/i.cluster/print1.c	2008-06-22 15:40:38 UTC (rev 31802)
@@ -13,11 +13,11 @@
 	C->nbands, C->nbands == 1 ? "" : "s");
     fprintf (fd, _(" means  "));
     for (band = 0; band < C->nbands; band++)
-	fprintf (fd," %6.2f",C->band_sum[band]/C->npoints);
+	fprintf (fd," %g",C->band_sum[band]/C->npoints);
     fprintf (fd,"\n");
     fprintf (fd, _(" stddev "));
     for (band = 0; band < C->nbands; band++)
-	fprintf (fd, " %6.2f",
+	fprintf (fd, " %g",
 	    I_stddev(C->band_sum[band], C->band_sum2[band], C->npoints));
     fprintf (fd, "\n\n");
 

Modified: grass/trunk/imagery/i.cluster/print2.c
===================================================================
--- grass/trunk/imagery/i.cluster/print2.c	2008-06-22 08:29:10 UTC (rev 31801)
+++ grass/trunk/imagery/i.cluster/print2.c	2008-06-22 15:40:38 UTC (rev 31802)
@@ -24,12 +24,12 @@
 	fprintf (fd, _("  means "));
 	if (n > 0)
 	    for (band = 0; band < C->nbands; band++)
-		fprintf (fd, " %6.2f", C->sum[band][c]/n);
+		fprintf (fd, " %g", C->sum[band][c]/n);
 	fprintf (fd, "\n");
 	fprintf (fd, _("  stddev"));
 	if (n > 1)
 	    for (band = 0; band < C->nbands; band++)
-		fprintf (fd, " %6.2f",
+		fprintf (fd, " %g",
 		    I_stddev(C->sum[band][c], C->sum2[band][c], n));
 	fprintf (fd, "\n");
     }

Modified: grass/trunk/imagery/i.cluster/print3.c
===================================================================
--- grass/trunk/imagery/i.cluster/print3.c	2008-06-22 08:29:10 UTC (rev 31801)
+++ grass/trunk/imagery/i.cluster/print3.c	2008-06-22 15:40:38 UTC (rev 31802)
@@ -19,7 +19,7 @@
     {
 	fprintf (fd, _("class %-3d "), c+1);
 	for (band = 0; band < C->nbands; band++)
-	    fprintf (fd, " %6.2f", C->mean[band][c]);
+	    fprintf (fd, " %g", C->mean[band][c]);
 	fprintf (fd, "\n");
     }
     fprintf (fd, "\n");

Modified: grass/trunk/lib/imagery/sig.c
===================================================================
--- grass/trunk/lib/imagery/sig.c	2008-06-22 08:29:10 UTC (rev 31801)
+++ grass/trunk/lib/imagery/sig.c	2008-06-22 15:40:38 UTC (rev 31802)
@@ -134,16 +134,16 @@
 	fprintf (fd, "#%s\n", s->desc);
 	fprintf (fd, "%d\n", s->npoints);
 	for (i=0; i < S->nbands; i++)
-	    fprintf(fd, "%f ", s->mean[i]);
+	    fprintf(fd, "%g ", s->mean[i]);
 	fprintf (fd, "\n");
 	for (i=0; i < S->nbands; i++)
 	{
 	    for (n=0; n <= i; n++)
-		fprintf (fd, "%f ", s->var[i][n]);
+		fprintf (fd, "%g ", s->var[i][n]);
 	    fprintf (fd, "\n");
 	}
 	if (s->have_color)
-	    fprintf (fd, "%f %f %f\n", s->r, s->g, s->b);
+	    fprintf (fd, "%g %g %g\n", s->r, s->g, s->b);
     }
     return 1;
 }



More information about the grass-commit mailing list