Browse Source

i.pansharpen: use standardized options
ms1->blue
ms2->green
ms3->red
output_prefix->basename
sharpen->method


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

Martin Landa 10 years ago
parent
commit
5bd3b1aeca
1 changed files with 20 additions and 24 deletions
  1. 20 24
      scripts/i.pansharpen/i.pansharpen.py

+ 20 - 24
scripts/i.pansharpen/i.pansharpen.py

@@ -46,34 +46,30 @@
 #%  keywords: PCA
 #%  overwrite: yes
 #%End
-#%option
-#%  key: sharpen
-#%  description: Choose pan sharpening method
-#%  options: brovey,ihs,pca
-#%  answer: ihs
-#%  required: yes
-#%end
 #%option G_OPT_R_INPUT
-#%  key: ms3
-#%  description: Input raster map for red channel
+#%  key: red
+#%  description: Name of raster map to be used for <red>
 #%end
 #%option G_OPT_R_INPUT
-#%  key: ms2
-#%  description: Input raster map for green channel
+#%  key: green
+#%  description: Name of raster map to be used for <green>
 #%end
 #%option G_OPT_R_INPUT
-#%  key: ms1
-#%  description: Input raster map for blue channel
+#%  key: blue
+#%  description: Name of raster map to be used for <blue>
 #%end
 #%  option G_OPT_R_INPUT
 #%  key: pan
-#%  description: Input raster map for high resolution panchromatic channel
+#%  description: Name of raster map to be used for high resolution panchromatic channel
+#%end
+#%option G_OPT_R_BASENAME_OUTPUT
 #%end
 #%option
-#%  key: output_prefix
-#%  type: string
-#%  description: Prefix for output raster maps
-#%  required : yes
+#%  key: method
+#%  description: Method for pan sharpening
+#%  options: brovey,ihs,pca
+#%  answer: ihs
+#%  required: yes
 #%end
 #%flag
 #%  key: s
@@ -81,7 +77,7 @@
 #%end
 #%flag
 #%  key: l
-#%  description: Rebalance blue channel for landsat maps
+#%  description: Rebalance blue channel for LANDSAT
 #%end
 
 import sys
@@ -99,12 +95,12 @@ def main():
     if not hasNumPy:
         grass.fatal(_("Required dependency NumPy not found. Exiting."))
 
-    sharpen   = options['sharpen'] # sharpening algorithm
-    ms1       = options['ms1'] # blue channel
-    ms2       = options['ms2'] # green channel
-    ms3       = options['ms3'] # red channel
+    sharpen   = options['method'] # sharpening algorithm
+    ms1       = options['blue'] # blue channel
+    ms2       = options['green'] # green channel
+    ms3       = options['red'] # red channel
     pan       = options['pan'] # high res pan channel
-    out       = options['output_prefix'] # prefix for output RGB maps
+    out       = options['basename'] # prefix for output RGB maps
     bladjust  = flags['l'] # adjust blue channel
     sproc     = flags['s'] # serial processing