瀏覽代碼

i.pca: be more verbose on std level
(merge https://trac.osgeo.org/grass/changeset/39581 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39582 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 15 年之前
父節點
當前提交
9905393c63
共有 1 個文件被更改,包括 9 次插入13 次删除
  1. 9 13
      imagery/i.pca/main.c

+ 9 - 13
imagery/i.pca/main.c

@@ -245,12 +245,11 @@ static int calc_mu(int *fds, double *mu, int bands)
 	if ((rowbuf = Rast_allocate_buf(maptype)) == NULL)
 	if ((rowbuf = Rast_allocate_buf(maptype)) == NULL)
 	    G_fatal_error(_("Unable allocate memory for row buffer"));
 	    G_fatal_error(_("Unable allocate memory for row buffer"));
 
 
-	G_verbose_message(_("Computing means for band %d..."), i + 1);
+	G_message(_("Computing means for band %d..."), i + 1);
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 	    void *ptr = rowbuf;
 	    void *ptr = rowbuf;
 
 
-	    if(G_verbose() > G_verbose_std())
-		G_percent(row, rows - 1, 2);
+	    G_percent(row, rows - 1, 2);
 
 
 	    if (Rast_get_row(fds[i], rowbuf, row, maptype) < 0)
 	    if (Rast_get_row(fds[i], rowbuf, row, maptype) < 0)
 		G_fatal_error(_("Unable to read raster map row %d"), row);
 		G_fatal_error(_("Unable to read raster map row %d"), row);
@@ -295,13 +294,12 @@ static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 	if ((rowbuf1 = Rast_allocate_buf(maptype)) == NULL)
 	if ((rowbuf1 = Rast_allocate_buf(maptype)) == NULL)
 	    G_fatal_error(_("Unable allocate memory for row buffer"));
 	    G_fatal_error(_("Unable allocate memory for row buffer"));
 
 
-	G_verbose_message(_("Computing row %d of covariance matrix..."),
-			  j + 1);
+	G_message(_("Computing row %d (of %d) of covariance matrix..."),
+		  j + 1, bands);
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 	    void *ptr1, *ptr2;
 	    void *ptr1, *ptr2;
 
 
-	    if(G_verbose() > G_verbose_std())
-		G_percent(row, rows - 1, 2);
+	    G_percent(row, rows - 1, 2);
 
 
 	    if (Rast_get_row(fds[j], rowbuf1, row, maptype) < 0)
 	    if (Rast_get_row(fds[j], rowbuf1, row, maptype) < 0)
 		G_fatal_error(_("Unable to read raster map row %d"), row);
 		G_fatal_error(_("Unable to read raster map row %d"), row);
@@ -384,7 +382,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 
 
 	sprintf(name, "%s.%d", out_basename, i + 1);
 	sprintf(name, "%s.%d", out_basename, i + 1);
 
 
-	G_verbose_message(_("Transforming <%s>..."), name);
+	G_message(_("Transforming <%s>..."), name);
 
 
 	/* open a new file for output */
 	/* open a new file for output */
 	if (scale)
 	if (scale)
@@ -403,7 +401,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 	    int row, col;
 	    int row, col;
 
 
 	    if (scale && (pass == PASSES)) {
 	    if (scale && (pass == PASSES)) {
-		G_verbose_message(_("Rescaling <%s> to range %d,%d..."),
+		G_message(_("Rescaling <%s> to range %d,%d..."),
 			  name, scale_min, scale_max);
 			  name, scale_min, scale_max);
 
 
 		old_range = max - min;
 		old_range = max - min;
@@ -413,8 +411,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 	    for (row = 0; row < rows; row++) {
 	    for (row = 0; row < rows; row++) {
 		void *rowptr;
 		void *rowptr;
 
 
-		if(G_verbose() > G_verbose_std())
-		    G_percent(row, rows, 2);
+		G_percent(row, rows, 2);
 
 
 		/* reset d_buf */
 		/* reset d_buf */
 		for (col = 0; col < cols; col++)
 		for (col = 0; col < cols; col++)
@@ -516,8 +513,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 		}
 		}
 	    }
 	    }
 
 
-	    if(G_verbose() > G_verbose_std())
-		G_percent(row, rows, 2);
+	    G_percent(row, rows, 2);
 
 
 	    /* close output file */
 	    /* close output file */
 	    if (pass == PASSES)
 	    if (pass == PASSES)