[GRASS-SVN] r61462 - grass-addons/grass7/raster/r.bioclim

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 30 10:08:10 PDT 2014


Author: neteler
Date: 2014-07-30 10:08:10 -0700 (Wed, 30 Jul 2014)
New Revision: 61462

Modified:
   grass-addons/grass7/raster/r.bioclim/r.bioclim.py
Log:
r.bioclim: add metadata to resulting files

Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.py
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.py	2014-07-30 15:17:01 UTC (rev 61461)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.py	2014-07-30 17:08:10 UTC (rev 61462)
@@ -159,6 +159,9 @@
     grass.mapcalc("$bio = round(double($oscale) * $input / $iscale)",
                   bio = outpre + '.bio01',
                   oscale = toutscale, input = output, iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio01',
+                      description = 'BIOCLIM01: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio01',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = output, quiet = True);
     
     # BIO2 = Mean Diurnal Range (Mean of monthly (max temp - min temp))
@@ -196,6 +199,9 @@
     grass.mapcalc("$bio = round(double($oscale) * $input / $iscale)",
                   bio = outpre + '.bio02',
                   oscale = toutscale, input = output, iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio02',
+                      description = 'BIOCLIM02: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio02',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = output, quiet = True);
     grass.run_command('g.mremove', type = 'rast', pattern = '%s.tr??.%d' % (outpre, pid), flags = 'f', quiet = True)
 
@@ -207,6 +213,9 @@
                   bio = outpre + '.bio04',
                   biotmp = output,
                   iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio04',
+                      description = 'BIOCLIM04: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio04',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = output, quiet = True);
 
     # BIO5 = Max Temperature of Warmest Month
@@ -218,6 +227,9 @@
                   oscale = toutscale,
                   iscale = tinscale,
                   biotmp = output)
+    grass.run_command('r.support', map = outpre + '.bio05',
+                      description = 'BIOCLIM05: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio05',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = output, quiet = True);
 
     # BIO6 = Min Temperature of Coldest Month
@@ -229,6 +241,9 @@
                   oscale = toutscale,
                   biotmp = output,
                   iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio06',
+                      description = 'BIOCLIM06: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio06',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = output, quiet = True);
 
     # BIO7 = Temperature Annual Range (BIO5-BIO6)
@@ -237,6 +252,9 @@
                   bio = outpre + '.bio07',
                   bio5 = outpre + '.bio05',
                   bio6 = outpre + '.bio06')
+    grass.run_command('r.support', map = outpre + '.bio07',
+                      description = 'BIOCLIM07: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio07',history = os.environ['CMDLINE'])
 
     # BIO3 = Isothermality (BIO2/BIO7) (* 100)
     grass.message(_("BIO3 = Isothermality (BIO2/BIO7) ..."))
@@ -244,6 +262,9 @@
                   bio = outpre + '.bio03',
                   bio2 = outpre + '.bio02',
                   bio7 = outpre + '.bio07')
+    grass.run_command('r.support', map = outpre + '.bio03',
+                      description = 'BIOCLIM03: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio03',history = os.environ['CMDLINE'])
 
     # mean of mean for each quarter year
     grass.message(_("Mean temperature for each quarter year ..."))
@@ -283,6 +304,12 @@
                   oscale = toutscale,
                   biotmp = bio11,
                   iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio10',
+                      description = 'BIOCLIM10: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio10',history = os.environ['CMDLINE'])
+    grass.run_command('r.support', map = outpre + '.bio11',
+                      description = 'BIOCLIM11: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio11',history = os.environ['CMDLINE'])
     grass.run_command('g.remove', rast = "%s,%s" % (bio10, bio11), quiet = True);
     
 
@@ -341,6 +368,9 @@
                   tavgq0 = tavgql[0], tavgq1 = tavgql[1],
                   tavgq2 = tavgql[2], tavgq3 = tavgql[3],
                   oscale = toutscale, iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio08',
+                      description = 'BIOCLIM08: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio08',history = os.environ['CMDLINE'])
 
     # BIO9 = Mean Temperature of Driest Quarter
     grass.message(_("BIO9 = Mean Temperature of Driest Quarter ..."))
@@ -355,11 +385,17 @@
                   tavgq0 = tavgql[0], tavgq1 = tavgql[1],
                   tavgq2 = tavgql[2], tavgq3 = tavgql[3],
                   oscale = toutscale, iscale = tinscale)
+    grass.run_command('r.support', map = outpre + '.bio09',
+                      description = 'BIOCLIM09: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio09',history = os.environ['CMDLINE'])
 
     # BIO12 = Annual Precipitation
     grass.message(_("BIO12 = Annual Precipitation ..."))
     output = outpre + '.bio12'
     grass.run_command('r.series', input = prec, output = output, method = 'sum')
+    grass.run_command('r.support', map = outpre + '.bio12',
+                      description = 'BIOCLIM12: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio12',history = os.environ['CMDLINE'])
 
     # BIO13 = Precipitation of Wettest Month
     # BIO14 = Precipitation of Driest Month
@@ -371,6 +407,12 @@
     grass.run_command('r.series', input = prec,
                       output = "%s,%s" % (bio13, bio14),
                       method = 'maximum,minimum')
+    grass.run_command('r.support', map = outpre + '.bio13',
+                      description = 'BIOCLIM13: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio13',history = os.environ['CMDLINE'])
+    grass.run_command('r.support', map = outpre + '.bio14',
+                      description = 'BIOCLIM14: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio14',history = os.environ['CMDLINE'])
 
 
     # BIO15 = Precipitation Seasonality (Coefficient of Variation)
@@ -384,6 +426,9 @@
                   bio = outpre + '.bio15',
                   precstddev = precstddev,
                   precavg = precavg)
+    grass.run_command('r.support', map = outpre + '.bio15',
+                      description = 'BIOCLIM15: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio15',history = os.environ['CMDLINE'])
 
     # BIO16 = Precipitation of Wettest Quarter
     # BIO17 = Precipitation of Driest Quarter
@@ -395,6 +440,12 @@
     grass.run_command('r.series', input = precq,
                       output = "%s,%s" % (bio16, bio17),
                       method = 'maximum,minimum')
+    grass.run_command('r.support', map = outpre + '.bio16',
+                      description = 'BIOCLIM16: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio16',history = os.environ['CMDLINE'])
+    grass.run_command('r.support', map = outpre + '.bio17',
+                      description = 'BIOCLIM17: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio17',history = os.environ['CMDLINE'])
 
     precql = precq.split(',')
 
@@ -409,6 +460,9 @@
                   warmestq = warmestq, 
                   precq0 = precql[0], precq1 = precql[1],
                   precq2 = precql[2], precq3 = precql[3])
+    grass.run_command('r.support', map = outpre + '.bio18',
+                      description = 'BIOCLIM18: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio18',history = os.environ['CMDLINE'])
 
     # BIO19 = Precipitation of Coldest Quarter
     grass.message(_("BIO19 = Precipitation of Coldest Quarter ..."))
@@ -421,6 +475,9 @@
                   coldestq = coldestq, 
                   precq0 = precql[0], precq1 = precql[1],
                   precq2 = precql[2], precq3 = precql[3])
+    grass.run_command('r.support', map = outpre + '.bio19',
+                      description = 'BIOCLIM19: Generated by r.bioclim')
+    grass.run_command('r.support', map = outpre + '.bio19',history = os.environ['CMDLINE'])
 
     grass.run_command('g.mremove', type = 'rast', pattern = tmp, flags = 'f', quiet = True)
 



More information about the grass-commit mailing list