[GRASS-SVN] r63214 - grass/branches/releasebranch_7_0/scripts/i.tasscap
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Nov 27 10:02:47 PST 2014
Author: neteler
Date: 2014-11-27 10:02:47 -0800 (Thu, 27 Nov 2014)
New Revision: 63214
Modified:
grass/branches/releasebranch_7_0/scripts/i.tasscap/i.tasscap.py
Log:
i.tasscap: write out some metadata
Modified: grass/branches/releasebranch_7_0/scripts/i.tasscap/i.tasscap.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/i.tasscap/i.tasscap.py 2014-11-27 17:59:29 UTC (rev 63213)
+++ grass/branches/releasebranch_7_0/scripts/i.tasscap/i.tasscap.py 2014-11-27 18:02:47 UTC (rev 63214)
@@ -42,7 +42,7 @@
#% keywords: Tasseled Cap transformation
#%end
#%option G_OPT_R_INPUTS
-#% description: For Landsat 4-7: bands 1, 2, 3, 4, 5, and 7
+#% description: For Landsat4-7: bands 1, 2, 3, 4, 5, and 7
#%end
#%option G_OPT_R_BASENAME_OUTPUT
#% label: Name for output basename raster map(s)
@@ -57,8 +57,6 @@
#% descriptions: landsat4_tm;Use transformation rules for Landsat 4 TM;landsat5_tm;Use transformation rules for Landsat 5 TM;landsat7_etm;Use transformation rules for Landsat 7 ETM
#%end
-import sys
-import os
import grass.script as grass
# weights for 6 Landsat bands: TM4, TM5, TM7
@@ -112,7 +110,7 @@
if band_num == 6:
band_num = 7
bands['band' + str(band_num)] = band
- print bands
+ grass.debug(1, bands)
if satellite == 'landsat4_tm':
calcN(output_basename, bands, 0, 4)
@@ -123,6 +121,11 @@
else:
raise RuntimeError("Invalid satellite: " + satellite)
+ grass.run_command('r.support', map = "%s.%d" % (output_basename, 1), description = "Tasseled Cap 1: brightness")
+ grass.run_command('r.support', map = "%s.%d" % (output_basename, 2), description = "Tasseled Cap 2: greenness")
+ grass.run_command('r.support', map = "%s.%d" % (output_basename, 3), description = "Tasseled Cap 3: wetness")
+ grass.run_command('r.support', map = "%s.%d" % (output_basename, 4), description = "Tasseled Cap 4: atmospheric haze")
+
grass.message(_("Tasseled Cap components calculated"))
if __name__ == "__main__":
More information about the grass-commit
mailing list