[GRASS-SVN] r71240 - grass-addons/grass7/imagery/i.spec.unmix

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jul 4 13:53:58 PDT 2017


Author: ychemin
Date: 2017-07-04 13:53:58 -0700 (Tue, 04 Jul 2017)
New Revision: 71240

Modified:
   grass-addons/grass7/imagery/i.spec.unmix/main.c
Log:
trying to rescale from 0-256 to 0-100, with according colour scheme

Modified: grass-addons/grass7/imagery/i.spec.unmix/main.c
===================================================================
--- grass-addons/grass7/imagery/i.spec.unmix/main.c	2017-07-04 11:11:34 UTC (rev 71239)
+++ grass-addons/grass7/imagery/i.spec.unmix/main.c	2017-07-04 20:53:58 UTC (rev 71240)
@@ -382,7 +382,7 @@
 	    /* write result in full percent */
 	    for (i = 0; i < A->cols; i++)	/* no. of spectra */
 		result_cell[i][col] =
-		    (CELL) (100 * G_matrix_get_element(fraction, 0, i));
+		    (CELL) (100 * G_matrix_get_element(fraction, 0, i) * 100.0/255.0);
 
 	    /* save error and iterations */
 	    error_cell[col] = (CELL) (100 * error);
@@ -419,7 +419,7 @@
 	/* make grey scale color table */
 	sprintf(result_name, "%s.%d", parm.result->answer, (i + 1));
 	sprintf(command, "r.colors map=%s color=rules <<EOF\n"
-		"0 0 0 0 \n" "201 0 255 0\n" "end\n" "EOF", result_name);
+		"0 0 0 0 \n" "100 255 255 255\n" "end\n" "EOF", result_name);
 
 	/* G_message(command); */
 	/* G_system (command); */



More information about the grass-commit mailing list