[GRASS-SVN] r61481 - in grass/trunk: gui/wxpython/xml scripts scripts/i.colors.enhance scripts/i.pansharpen

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 31 10:04:06 PDT 2014


Author: neteler
Date: 2014-07-31 10:04:05 -0700 (Thu, 31 Jul 2014)
New Revision: 61481

Added:
   grass/trunk/scripts/i.colors.enhance/
   grass/trunk/scripts/i.colors.enhance/i.colors.enhance.html
   grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py
   grass/trunk/scripts/i.colors.enhance/i_col_enh_corr.jpg
   grass/trunk/scripts/i.colors.enhance/i_col_enh_uncorr.jpg
Removed:
   grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.html
   grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.py
   grass/trunk/scripts/i.colors.enhance/i_landsat_rgb_corrected.jpg
   grass/trunk/scripts/i.colors.enhance/i_landsat_rgb_uncorrected.jpg
   grass/trunk/scripts/i.landsat.rgb/
Modified:
   grass/trunk/gui/wxpython/xml/toolboxes.xml
   grass/trunk/scripts/Makefile
   grass/trunk/scripts/i.colors.enhance/Makefile
   grass/trunk/scripts/i.pansharpen/i.pansharpen.html
   grass/trunk/scripts/i.pansharpen/i.pansharpen.py
Log:
i.landsat.rgb renamed to i.colors.enhance (trac #2340)

Modified: grass/trunk/gui/wxpython/xml/toolboxes.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/toolboxes.xml	2014-07-31 16:53:22 UTC (rev 61480)
+++ grass/trunk/gui/wxpython/xml/toolboxes.xml	2014-07-31 17:04:05 UTC (rev 61481)
@@ -1491,7 +1491,7 @@
   <toolbox name="ManageImageColors">
     <label>Manage image colors</label>
     <items>
-      <module-item name="i.landsat.rgb">
+      <module-item name="i.colors.enhance">
         <label>Color balance for RGB</label>
       </module-item>
       <module-item name="i.his.rgb">

Modified: grass/trunk/scripts/Makefile
===================================================================
--- grass/trunk/scripts/Makefile	2014-07-31 16:53:22 UTC (rev 61480)
+++ grass/trunk/scripts/Makefile	2014-07-31 17:04:05 UTC (rev 61481)
@@ -18,9 +18,9 @@
 	g.extension \
 	g.extension.all \
 	g.manual \
+	i.colors.enhance \
 	i.image.mosaic \
 	i.in.spotvgt \
-	i.landsat.rgb \
 	i.oif \
 	i.pansharpen \
 	i.spectral \

Modified: grass/trunk/scripts/i.colors.enhance/Makefile
===================================================================
--- grass/trunk/scripts/i.landsat.rgb/Makefile	2014-07-31 15:19:16 UTC (rev 61478)
+++ grass/trunk/scripts/i.colors.enhance/Makefile	2014-07-31 17:04:05 UTC (rev 61481)
@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-PGM = i.landsat.rgb
+PGM = i.colors.enhance
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 

Copied: grass/trunk/scripts/i.colors.enhance/i.colors.enhance.html (from rev 61478, grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb.html)
===================================================================
--- grass/trunk/scripts/i.colors.enhance/i.colors.enhance.html	                        (rev 0)
+++ grass/trunk/scripts/i.colors.enhance/i.colors.enhance.html	2014-07-31 17:04:05 UTC (rev 61481)
@@ -0,0 +1,75 @@
+<h2>DESCRIPTION</h2>
+
+<em>i.colors.enhance</em> auto-balances and enhances the color channels of a
+RGB image (e.g. from Landsat) to provide a more natural color mixture. Only
+the color table of each image band is modified, the base data remains untouched.
+<p>
+The module works by calculating a histogram for each color channel and 
+removing an adjustable amount of outliers from either end before recalibrating
+the color scale with <em>r.colors</em>.
+<p>
+<!-- limitation still true ? -->
+It will work with any 8-bit RGB imagery set and the script is easily modified
+to work with other datasets of greater band-depth.
+
+<h2>NOTES</h2>
+
+Depending on the image, it may or may not be advantageous to use the <b>-p</b>
+flag to preserve the relative color scaling. You will have to experiment
+with the different options to find a setting that works best for your
+particular imagery.
+<p>
+The <b>strength</b> option should generally be set in the 90-99 range. The
+lower the number, the more saturated the image becomes. It represents the
+percentage cut-off for the top end of the color histogram curve. The lower
+end is fixed at 2% of the area under the curve.
+<p>
+For quicker execution of this module on large images you can achieve largely
+similar results by switching to a coarser resolution before the running of
+the module (using <em>g.region</em>) and then back to the original resolution
+afterwards.
+
+<h2>EXAMPLE</h2>
+
+North Carolina sample dataset example with Landsat data:
+
+<div class="code"><pre>
+g.region rast=lsat7_2002_10 -p
+d.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30
+d.barscale at=55.3125,93.125 bcolor=white text_pos=over
+
+i.colors.enhance blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30 strength=95
+d.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30
+d.barscale at=55.3125,93.125 bcolor=white text_pos=over
+</pre></div>
+
+<center>
+<img src="i_col_enh_uncorr.jpg" alt="Uncorrected RGB composite of Landsat ETM channels B/G/R"><br>
+Uncorrected RGB composite of Landsat ETM channels B/G/R
+<p>
+<img src="i_col_enh_corr.jpg" alt="Color corrected RGB composite of Landsat ETM channels B/G/R"><br>
+Color corrected RGB composite of Landsat ETM channels B/G/R
+</center>
+
+<h2>TODO</h2>
+
+The <b>strength</b> option requires further refinement.
+
+<h2>SEE ALSO</h2>
+
+<em>
+<a href="d.rgb.html">d.rgb</a>,
+<a href="g.region.html">g.region</a>,
+<a href="i.oif.html">i.oif</a>,
+<a href="r.colors.html">r.colors</a>,
+<a href="r.composite.html">r.composite</a>,
+<a href="r.univar.html">r.univar</a>
+</em>
+
+
+<h2>AUTHORS</h2>
+
+Markus Neteler, Trento, Italy<br>
+M. Hamish Bowman, Dept. Marine Science, Otago University, New Zealand
+
+<p><i>Last changed: $Date$</i>

Copied: grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py (from rev 61478, grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb.py)
===================================================================
--- grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py	                        (rev 0)
+++ grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py	2014-07-31 17:04:05 UTC (rev 61481)
@@ -0,0 +1,226 @@
+#!/usr/bin/env python
+
+############################################################################
+#
+# MODULE:	i.colors.enhance (former i.landsat.rgb)
+#
+# AUTHOR(S):	Markus Neteler, original author
+#		Hamish Bowman, scripting enhancements
+#               Converted to Python by Glynn Clements
+#
+# PURPOSE:      create pretty RGBs: the trick is to remove outliers 
+#               using percentiles (area under the histogram curve)
+#
+# COPYRIGHT:	(C) 2006, 2008, 2012-2014 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (>=v2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+# TODO: implement better brightness control
+#############################################################################
+
+#%module
+#% description: Performs auto-balancing of colors for RGB images.
+#% keywords: imagery
+#% keywords: RGB
+#% keywords: satellite
+#% keywords: colors
+#%end
+#%option G_OPT_R_INPUT
+#% key: red
+#% description: Name of red channel
+#%end
+#%option G_OPT_R_INPUT
+#% key: green
+#% description: Name of green channel
+#%end
+#%option G_OPT_R_INPUT
+#% key: blue
+#% description: Name of blue channel
+#%end
+#%option
+#% key: strength
+#% type: double
+#% description: Cropping intensity (upper brightness level)
+#% options: 0-100
+#% answer : 98
+#% required: no
+#%end
+#%flag
+#% key: f
+#% description: Extend colors to full range of data on each channel
+#% guisection: Colors
+#%end
+#%flag
+#% key: p
+#% description: Preserve relative colors, adjust brightness only
+#% guisection: Colors
+#%end
+#%flag
+#% key: r
+#% description: Reset to standard color range
+#% guisection: Colors
+#%end
+#%flag
+#% key: s
+#% description: Process bands serially (default: run in parallel)
+#%end
+
+import sys
+import os
+import string
+import grass.script as grass
+try:
+    # new for python 2.6, in 2.5 it may be easy_install'd.
+    import multiprocessing as mp
+    do_mp = True
+except:
+    do_mp = False
+
+
+def get_percentile(map, percentiles):
+    # todo: generalize for any list length
+    val1 = percentiles[0]
+    val2 = percentiles[1]
+    values = '%s,%s' % (val1, val2)
+    s = grass.read_command('r.univar', flags = 'ge',
+			   map = map, percentile = values)
+    kv = grass.parse_key_val(s)
+    # cleanse to match what the key name will become
+    val_str1 = ('percentile_%.15g' % float(val1)).replace('.','_')
+    val_str2 = ('percentile_%.15g' % float(val2)).replace('.','_')
+    return (float(kv[val_str1]), float(kv[val_str2]))
+
+# wrapper to handle multiprocesses communications back to the parent
+def get_percentile_mp(map, percentiles, conn):
+    # Process() doesn't like storing connection parts in
+    #  separate dictionaries, only wants to pass through tuples,
+    #  so instead of just sending the sending the pipe we have to
+    #  send both parts then keep the one we want.  ??
+    output_pipe, input_pipe = conn
+    input_pipe.close()
+    result = get_percentile(map, percentiles)
+    grass.debug('child (%s) (%.1f, %.1f)' % (map, result[0], result[1]))
+    output_pipe.send(result)
+    output_pipe.close()
+
+def set_colors(map, v0, v1):
+    rules = [
+	"0% black\n",
+	"%f black\n" % v0,
+	"%f white\n" % v1,
+	"100% white\n"
+	]
+    rules = ''.join(rules)
+    grass.write_command('r.colors', map = map, rules = '-', stdin = rules, quiet = True)
+
+
+def main():
+    red = options['red']
+    green = options['green']
+    blue = options['blue']
+    brightness = options['strength']
+    full = flags['f']
+    preserve = flags['p']
+    reset = flags['r']
+    
+    global do_mp
+
+    if flags['s']:
+        do_mp = False
+
+    # 90 or 98? MAX value controls brightness
+    # think of percent (0-100), must be positive or 0
+    # must be more than "2" ?
+
+    if full:
+	for i in [red, green, blue]:
+	    grass.run_command('r.colors', map = i, color = 'grey', quiet = True)
+	sys.exit(0)
+
+    if reset:
+	for i in [red, green, blue]:
+	    grass.run_command('r.colors', map = i, color = 'grey255', quiet = True)
+	sys.exit(0)
+
+
+    if not preserve:
+        if do_mp:
+            grass.message(_("Processing..."))
+	    # set up jobs and launch them
+	    proc = {}
+	    conn = {}
+	    for i in [red, green, blue]:
+	        conn[i] = mp.Pipe()
+	        proc[i] = mp.Process(target = get_percentile_mp,
+				     args = (i, ['2', brightness],
+				     conn[i],))
+		proc[i].start()
+            grass.percent(1, 2, 1)
+            
+	    # collect results and wait for jobs to finish
+	    for i in [red, green, blue]:
+		output_pipe, input_pipe = conn[i]
+		(v0, v1) = input_pipe.recv()
+		grass.debug('parent (%s) (%.1f, %.1f)' % (i, v0, v1))
+		input_pipe.close()
+		proc[i].join()
+		set_colors(i, v0, v1)
+            grass.percent(1, 1, 1)
+	else:
+	    for i in [red, green, blue]:
+	        grass.message(_("Processing..."))
+	        (v0, v1) = get_percentile(i, ['2', brightness])
+	        grass.debug("<%s>:  min=%f   max=%f" % (i, v0, v1))
+	        set_colors(i, v0, v1)
+
+    else:
+	all_max = 0
+	all_min = 999999
+
+	if do_mp:
+	    grass.message(_("Processing..."))
+	    # set up jobs and launch jobs
+	    proc = {}
+	    conn = {}
+	    for i in [red, green, blue]:
+		conn[i] = mp.Pipe()
+		proc[i] = mp.Process(target = get_percentile_mp,
+				     args = (i, ['2', brightness],
+				     conn[i],))
+		proc[i].start()
+            grass.percent(1, 2, 1)
+            
+	    # collect results and wait for jobs to finish
+	    for i in [red, green, blue]:
+		output_pipe, input_pipe = conn[i]
+		(v0, v1) = input_pipe.recv()
+		grass.debug('parent (%s) (%.1f, %.1f)' % (i, v0, v1))
+		input_pipe.close()
+		proc[i].join()
+		all_min = min(all_min, v0)
+		all_max = max(all_max, v1)
+            grass.percent(1, 1, 1)
+	else:
+	    for i in [red, green, blue]:
+		grass.message(_("Processing..."))
+		(v0, v1) = get_percentile(i, ['2', brightness])
+		grass.debug("<%s>:  min=%f   max=%f" % (i, v0, v1))
+		all_min = min(all_min, v0)
+		all_max = max(all_max, v1)
+
+	grass.debug("all_min=%f   all_max=%f" % (all_min, all_max))
+	for i in [red, green, blue]:
+	    set_colors(i, all_min, all_max)
+
+
+    # write cmd history:
+    mapset = grass.gisenv()['MAPSET']
+    for i in [red, green, blue]:
+        if grass.find_file(i)['mapset'] == mapset:
+            grass.raster_history(i)
+
+if __name__ == "__main__":
+    options, flags = grass.parser()
+    main()

Deleted: grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.html
===================================================================
--- grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb.html	2014-07-31 15:19:16 UTC (rev 61478)
+++ grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.html	2014-07-31 17:04:05 UTC (rev 61481)
@@ -1,74 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>i.landsat.rgb</em> auto-balances and enhances the color channels of a
-LANDSAT RGB image to provide a more natural color mixture. Only the color
-table of each image band is modified, the base data remains untouched.
-<p>
-The module works by calculating a histogram for each color channel and 
-removing an adjustable amount of outliers from either end before recalibrating
-the color scale with <em>r.colors</em>.
-<p>
-It will work with any 8-bit RGB imagery set and the script is easily modified
-to work with other datasets of greater band-depth.
-
-<h2>NOTES</h2>
-
-Depending on the image, it may or may not be advantageous to use the <b>-p</b>
-flag to preserve the relative color scaling. You will have to experiment
-with the different options to find a setting that works best for your
-particular imagery.
-<p>
-The <b>strength</b> option should generally be set in the 90-99 range. The
-lower the number, the more saturated the image becomes. It represents the
-percentage cut-off for the top end of the color histogram curve. The lower
-end is fixed at 2% of the area under the curve.
-<p>
-For quicker execution of this module on large images you can achieve largely
-similar results by switching to a coarser resolution before the running of
-the module (using <em>g.region</em>) and then back to the original resolution
-afterwards.
-
-<h2>EXAMPLE</h2>
-
-North Carolina sample dataset example:
-
-<div class="code"><pre>
-g.region rast=lsat7_2002_10 -p
-d.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30
-d.barscale at=55.3125,93.125 bcolor=white text_pos=over
-
-i.landsat.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30 strength=95
-d.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30
-d.barscale at=55.3125,93.125 bcolor=white text_pos=over
-</pre></div>
-
-<center>
-<img src="i_landsat_rgb_uncorrected.jpg" alt="Uncorrected RGB composite of Landsat ETM channels B/G/R"><br>
-Uncorrected RGB composite of Landsat ETM channels B/G/R
-<p>
-<img src="i_landsat_rgb_corrected.jpg" alt="Color corrected RGB composite of Landsat ETM channels B/G/R"><br>
-Color corrected RGB composite of Landsat ETM channels B/G/R
-</center>
-
-<h2>TODO</h2>
-
-The <b>strength</b> option requires further refinement.
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="d.rgb.html">d.rgb</a>,
-<a href="g.region.html">g.region</a>,
-<a href="i.oif.html">i.oif</a>,
-<a href="r.colors.html">r.colors</a>,
-<a href="r.composite.html">r.composite</a>,
-<a href="r.univar.html">r.univar</a>
-</em>
-
-
-<h2>AUTHORS</h2>
-
-Markus Neteler, Trento, Italy<br>
-M. Hamish Bowman, Dept. Marine Science, Otago University, New Zealand
-
-<p><i>Last changed: $Date$</i>

Deleted: grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.py
===================================================================
--- grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb.py	2014-07-31 15:19:16 UTC (rev 61478)
+++ grass/trunk/scripts/i.colors.enhance/i.landsat.rgb.py	2014-07-31 17:04:05 UTC (rev 61481)
@@ -1,225 +0,0 @@
-#!/usr/bin/env python
-
-############################################################################
-#
-# MODULE:	i.landsat.rgb
-#
-# AUTHOR(S):	Markus Neteler. <neteler itc it>
-#		Hamish Bowman, scripting enhancements
-#               Converted to Python by Glynn Clements
-#
-# PURPOSE:      create pretty LANDSAT RGBs: the trick is to remove outliers 
-#               using percentiles (area under the histogram curve)
-#
-# COPYRIGHT:	(C) 2006, 2008, 2012 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# TODO: implement better brightness control
-#############################################################################
-
-#%module
-#% description: Performs auto-balancing of colors for LANDSAT images.
-#% keywords: imagery
-#% keywords: landsat
-#% keywords: colors
-#%end
-#%option G_OPT_R_INPUT
-#% key: red
-#% description: Name of LANDSAT red channel
-#%end
-#%option G_OPT_R_INPUT
-#% key: green
-#% description: Name of LANDSAT green channel
-#%end
-#%option G_OPT_R_INPUT
-#% key: blue
-#% description: Name of LANDSAT blue channel
-#%end
-#%option
-#% key: strength
-#% type: double
-#% description: Cropping intensity (upper brightness level)
-#% options: 0-100
-#% answer : 98
-#% required: no
-#%end
-#%flag
-#% key: f
-#% description: Extend colors to full range of data on each channel
-#% guisection: Colors
-#%end
-#%flag
-#% key: p
-#% description: Preserve relative colors, adjust brightness only
-#% guisection: Colors
-#%end
-#%flag
-#% key: r
-#% description: Reset to standard color range
-#% guisection: Colors
-#%end
-#%flag
-#% key: s
-#% description: Process bands serially (default: run in parallel)
-#%end
-
-import sys
-import os
-import string
-import grass.script as grass
-try:
-    # new for python 2.6, in 2.5 it may be easy_install'd.
-    import multiprocessing as mp
-    do_mp = True
-except:
-    do_mp = False
-
-
-def get_percentile(map, percentiles):
-    # todo: generalize for any list length
-    val1 = percentiles[0]
-    val2 = percentiles[1]
-    values = '%s,%s' % (val1, val2)
-    s = grass.read_command('r.univar', flags = 'ge',
-			   map = map, percentile = values)
-    kv = grass.parse_key_val(s)
-    # cleanse to match what the key name will become
-    val_str1 = ('percentile_%.15g' % float(val1)).replace('.','_')
-    val_str2 = ('percentile_%.15g' % float(val2)).replace('.','_')
-    return (float(kv[val_str1]), float(kv[val_str2]))
-
-# wrapper to handle multiprocesses communications back to the parent
-def get_percentile_mp(map, percentiles, conn):
-    # Process() doesn't like storing connection parts in
-    #  separate dictionaries, only wants to pass through tuples,
-    #  so instead of just sending the sending the pipe we have to
-    #  send both parts then keep the one we want.  ??
-    output_pipe, input_pipe = conn
-    input_pipe.close()
-    result = get_percentile(map, percentiles)
-    grass.debug('child (%s) (%.1f, %.1f)' % (map, result[0], result[1]))
-    output_pipe.send(result)
-    output_pipe.close()
-
-def set_colors(map, v0, v1):
-    rules = [
-	"0% black\n",
-	"%f black\n" % v0,
-	"%f white\n" % v1,
-	"100% white\n"
-	]
-    rules = ''.join(rules)
-    grass.write_command('r.colors', map = map, rules = '-', stdin = rules, quiet = True)
-
-
-def main():
-    red = options['red']
-    green = options['green']
-    blue = options['blue']
-    brightness = options['strength']
-    full = flags['f']
-    preserve = flags['p']
-    reset = flags['r']
-    
-    global do_mp
-
-    if flags['s']:
-        do_mp = False
-
-    # 90 or 98? MAX value controls brightness
-    # think of percent (0-100), must be positive or 0
-    # must be more than "2" ?
-
-    if full:
-	for i in [red, green, blue]:
-	    grass.run_command('r.colors', map = i, color = 'grey', quiet = True)
-	sys.exit(0)
-
-    if reset:
-	for i in [red, green, blue]:
-	    grass.run_command('r.colors', map = i, color = 'grey255', quiet = True)
-	sys.exit(0)
-
-
-    if not preserve:
-        if do_mp:
-            grass.message(_("Processing..."))
-	    # set up jobs and launch them
-	    proc = {}
-	    conn = {}
-	    for i in [red, green, blue]:
-	        conn[i] = mp.Pipe()
-	        proc[i] = mp.Process(target = get_percentile_mp,
-				     args = (i, ['2', brightness],
-				     conn[i],))
-		proc[i].start()
-            grass.percent(1, 2, 1)
-            
-	    # collect results and wait for jobs to finish
-	    for i in [red, green, blue]:
-		output_pipe, input_pipe = conn[i]
-		(v0, v1) = input_pipe.recv()
-		grass.debug('parent (%s) (%.1f, %.1f)' % (i, v0, v1))
-		input_pipe.close()
-		proc[i].join()
-		set_colors(i, v0, v1)
-            grass.percent(1, 1, 1)
-	else:
-	    for i in [red, green, blue]:
-	        grass.message(_("Processing..."))
-	        (v0, v1) = get_percentile(i, ['2', brightness])
-	        grass.debug("<%s>:  min=%f   max=%f" % (i, v0, v1))
-	        set_colors(i, v0, v1)
-
-    else:
-	all_max = 0
-	all_min = 999999
-
-	if do_mp:
-	    grass.message(_("Processing..."))
-	    # set up jobs and launch jobs
-	    proc = {}
-	    conn = {}
-	    for i in [red, green, blue]:
-		conn[i] = mp.Pipe()
-		proc[i] = mp.Process(target = get_percentile_mp,
-				     args = (i, ['2', brightness],
-				     conn[i],))
-		proc[i].start()
-            grass.percent(1, 2, 1)
-            
-	    # collect results and wait for jobs to finish
-	    for i in [red, green, blue]:
-		output_pipe, input_pipe = conn[i]
-		(v0, v1) = input_pipe.recv()
-		grass.debug('parent (%s) (%.1f, %.1f)' % (i, v0, v1))
-		input_pipe.close()
-		proc[i].join()
-		all_min = min(all_min, v0)
-		all_max = max(all_max, v1)
-            grass.percent(1, 1, 1)
-	else:
-	    for i in [red, green, blue]:
-		grass.message(_("Processing..."))
-		(v0, v1) = get_percentile(i, ['2', brightness])
-		grass.debug("<%s>:  min=%f   max=%f" % (i, v0, v1))
-		all_min = min(all_min, v0)
-		all_max = max(all_max, v1)
-
-	grass.debug("all_min=%f   all_max=%f" % (all_min, all_max))
-	for i in [red, green, blue]:
-	    set_colors(i, all_min, all_max)
-
-
-    # write cmd history:
-    mapset = grass.gisenv()['MAPSET']
-    for i in [red, green, blue]:
-        if grass.find_file(i)['mapset'] == mapset:
-            grass.raster_history(i)
-
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()

Copied: grass/trunk/scripts/i.colors.enhance/i_col_enh_corr.jpg (from rev 61478, grass/trunk/scripts/i.landsat.rgb/i_landsat_rgb_corrected.jpg)
===================================================================
(Binary files differ)

Copied: grass/trunk/scripts/i.colors.enhance/i_col_enh_uncorr.jpg (from rev 61478, grass/trunk/scripts/i.landsat.rgb/i_landsat_rgb_uncorrected.jpg)
===================================================================
(Binary files differ)

Deleted: grass/trunk/scripts/i.colors.enhance/i_landsat_rgb_corrected.jpg
===================================================================
(Binary files differ)

Deleted: grass/trunk/scripts/i.colors.enhance/i_landsat_rgb_uncorrected.jpg
===================================================================
(Binary files differ)

Modified: grass/trunk/scripts/i.pansharpen/i.pansharpen.html
===================================================================
--- grass/trunk/scripts/i.pansharpen/i.pansharpen.html	2014-07-31 16:53:22 UTC (rev 61480)
+++ grass/trunk/scripts/i.pansharpen/i.pansharpen.html	2014-07-31 17:04:05 UTC (rev 61481)
@@ -74,7 +74,7 @@
 but does use an optimized r.mapcalc expression to reduce disk I/O.
 <br><br>
 The three pan-sharpened output channels may be combined with <em>d.rgb</em> or 
-<em>r.composite</em>. Colors may be optionally optimized with <em>i.landsat.rgb</em>.
+<em>r.composite</em>. Colors may be optionally optimized with <em>i.colors.enhance</em>.
 While the resulting color image will be at the higher resolution in all cases, 
 the 3 pan sharpening algorithms differ in terms of spectral response.  
 
@@ -163,7 +163,7 @@
 g.gui.mapswipe
 
 # optionally color balancing:
-i.landsat.rgb r=lsat7_2002_ihs_red g=lsat7_2002_ihs_green b=lsat7_2002_ihs_blue
+i.colors.enhance r=lsat7_2002_ihs_red g=lsat7_2002_ihs_green b=lsat7_2002_ihs_blue
 </pre></div>
 
 <h2>SEE ALSO</h2>

Modified: grass/trunk/scripts/i.pansharpen/i.pansharpen.py
===================================================================
--- grass/trunk/scripts/i.pansharpen/i.pansharpen.py	2014-07-31 16:53:22 UTC (rev 61480)
+++ grass/trunk/scripts/i.pansharpen/i.pansharpen.py	2014-07-31 17:04:05 UTC (rev 61481)
@@ -334,7 +334,7 @@
     grass.message(_("d.rgb r=%s_red g=%s_green b=%s_blue" % (out, out, out)))
     grass.message('\n ')
     grass.message(_("If desired, combine channels into a single RGB map with 'r.composite'."))
-    grass.message(_("Channel colors can be rebalanced using i.landsat.rgb."))
+    grass.message(_("Channel colors can be rebalanced using i.colors.enhance."))
 
     # write cmd history:
     for ch in ['red', 'green', 'blue']:



More information about the grass-commit mailing list