[GRASS-SVN] r34378 - grass/branches/develbranch_6/scripts/i.fusion.brovey

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 18 15:37:43 EST 2008


Author: martinl
Date: 2008-11-18 15:37:43 -0500 (Tue, 18 Nov 2008)
New Revision: 34378

Modified:
   grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey
Log:
i.fusion.brovey: message standardization + verbose mode


Modified: grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey
===================================================================
--- grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey	2008-11-18 20:21:31 UTC (rev 34377)
+++ grass/branches/develbranch_6/scripts/i.fusion.brovey/i.fusion.brovey	2008-11-18 20:37:43 UTC (rev 34378)
@@ -28,53 +28,56 @@
 
 #%Module
 #%  description: Brovey transform to merge multispectral and high-res panchromatic channels
-#%  keywords: raster, imagery, fusion
+#%  keywords: imagery, fusion, Brovey
 #%End
 #%Flag
 #%  key: l
-#%  description: sensor: LANDSAT
+#%  description: LANDSAT sensor
+#%  guisection: Sensor
 #%END
 #%Flag
 #%  key: q
-#%  description: sensor: QuickBird
+#%  description: QuickBird sensor
+#%  guisection: Sensor
 #%END
 #%Flag
 #%  key: s
-#%  description: sensor: SPOT
+#%  description: SPOT sensor
+#%  guisection: Sensor
 #%END
 #%option
 #% key: ms1
 #% type: string
 #% gisprompt: old,cell,raster
-#% description: raster input map (green: tm2 | qbird_green | spot1)
+#% description: Name of input raster map (green: tm2 | qbird_green | spot1)
 #% required : yes
 #%end
 #%option
 #% key: ms2
 #% type: string
 #% gisprompt: old,cell,raster
-#% description: raster input map (NIR: tm4 | qbird_nir | spot2)
+#% description: Name of input raster map (NIR: tm4 | qbird_nir | spot2)
 #% required : yes
 #%end
 #%option
 #% key: ms3
 #% type: string
 #% gisprompt: old,cell,raster
-#% description: raster input map (MIR; tm5 | qbird_red | spot3)
+#% description: Name of input raster map (MIR; tm5 | qbird_red | spot3)
 #% required : yes
 #%end
 #%option
 #% key: pan
 #% type: string
 #% gisprompt: old,cell,raster
-#% description: raster input map (etmpan | qbird_pan | spotpan)
+#% description: Name of input raster map (etmpan | qbird_pan | spotpan)
 #% required : yes
 #%end
 #%option
 #% key: outputprefix
 #% type: string
 #% gisprompt: new,cell,raster
-#% description: raster output map prefix (e.g. 'brov')
+#% description: Name for output raster map prefix (e.g. 'brov')
 #% required : yes
 #%end
 
@@ -143,12 +146,12 @@
 # clone current region
 g.region save="i.fusion.brovey.$TMP"
 
-g.message message="Using resolution from PAN: $PANRES"
+g.message -v message="Using resolution from PAN: $PANRES"
 WIND_OVERRIDE="i.fusion.brovey.$TMP"
 export WIND_OVERRIDE
 g.region res="$PANRES" -a
 
-g.message "Performing Brovey transformation..."
+g.message -v "Performing Brovey transformation..."
 
 # The formula was originally developed for LANDSAT-TM5 and SPOT, 
 # but it also works well with LANDSAT-TM7
@@ -163,7 +166,7 @@
 # r.mapcalc "brov.blue= 1. * spot.ms.1 / (spot.ms.1 + spot.ms.2 + spot.ms.3) * spot.p"
 # note: for RGB composite then revert brov.red and brov.green!
 
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.red: ...(step 1/4)"
+g.message message="Calculating <$GIS_OPT_OUTPUTPREFIX.red>... (step 1/4)"
 r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.red\" = 1. * \"$GIS_OPT_MS3\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
 if [ $? -ne 0 ] ; then
    g.message -e "An error occurred while running r.mapcalc"
@@ -171,7 +174,7 @@
    exit 1
 fi
 
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.green: ...(step 2/4)"
+g.message message="Calculating <$GIS_OPT_OUTPUTPREFIX.green>... (step 2/4)"
 r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.green\" = 1. * \"$GIS_OPT_MS2\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
 if [ $? -ne 0 ] ; then
    g.message -e "An error occurred while running r.mapcalc"
@@ -179,7 +182,7 @@
    exit 1
 fi
 
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.blue: ...(step 3/4)"
+g.message message="Calculating <$GIS_OPT_OUTPUTPREFIX.blue>... (step 3/4)"
 r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.blue\" = 1. * \"$GIS_OPT_MS1\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
 if [ $? -ne 0 ] ; then
    g.message -e "An error occurred while running r.mapcalc"
@@ -201,7 +204,7 @@
 
 if [ $GIS_FLAG_S -eq 1 ] ; then
    #apect table is nice for SPOT:
-   g.message message="Assigning color tables for SPOT ...(step 4/4)"
+   g.message message="Assigning color tables for SPOT... (step 4/4)"
    r.colors "$GIS_OPT_OUTPUTPREFIX.blue" col=aspect
    r.colors "$GIS_OPT_OUTPUTPREFIX.green" col=aspect
    r.colors "$GIS_OPT_OUTPUTPREFIX.red" col=aspect
@@ -211,13 +214,13 @@
    g.rename "$GIS_OPT_OUTPUTPREFIX.$TMP","$GIS_OPT_OUTPUTPREFIX.red" --quiet
 else
    #aspect table is nice for LANDSAT and QuickBird:
-   g.message message="Assigning color tables for LANDSAT or QuickBird ...(step 4/4)"
+   g.message message="Assigning color tables for LANDSAT or QuickBird... (step 4/4)"
    r.colors "$GIS_OPT_OUTPUTPREFIX.blue" col=aspect
    r.colors "$GIS_OPT_OUTPUTPREFIX.green" col=aspect
    r.colors "$GIS_OPT_OUTPUTPREFIX.red" col=aspect
 fi
 
-g.message "Restoring region settings."
+g.message -v "Restoring region settings."
 cleanup
 
 g.message "Following pan-sharpened output maps have been generated:"
@@ -225,10 +228,10 @@
 echo "$GIS_OPT_OUTPUTPREFIX.green"
 echo "$GIS_OPT_OUTPUTPREFIX.blue"
 
-g.message "To visualize output, run:"
-g.message message="g.region -p rast=$GIS_OPT_OUTPUTPREFIX.red ; d.erase"
-g.message message="d.rgb r=$GIS_OPT_OUTPUTPREFIX.red g=$GIS_OPT_OUTPUTPREFIX.green b=$GIS_OPT_OUTPUTPREFIX.blue"
-g.message "If desired, combine channels with 'r.composite' to a single map."
+g.message -v "To visualize output, run:"
+g.message -v message="g.region -p rast=$GIS_OPT_OUTPUTPREFIX.red ; d.erase"
+g.message -v message="d.rgb r=$GIS_OPT_OUTPUTPREFIX.red g=$GIS_OPT_OUTPUTPREFIX.green b=$GIS_OPT_OUTPUTPREFIX.blue"
+g.message -v "If desired, combine channels with 'r.composite' to a single map."
 
 # write cmd history:
 r.support "$GIS_OPT_OUTPUTPREFIX.red" history="${CMDLINE}"



More information about the grass-commit mailing list