[GRASS-SVN] r67164 - grass-addons/grass7/raster/r.bioclim
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 16 01:34:18 PST 2015
Author: mmetz
Date: 2015-12-16 01:34:18 -0800 (Wed, 16 Dec 2015)
New Revision: 67164
Modified:
grass-addons/grass7/raster/r.bioclim/r.bioclim.html
grass-addons/grass7/raster/r.bioclim/r.bioclim.py
Log:
r.bioclim: +user-defined output separator
Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.html
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.html 2015-12-16 09:23:13 UTC (rev 67163)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.html 2015-12-16 09:34:18 UTC (rev 67164)
@@ -3,10 +3,12 @@
<em><b>r.bioclim</b></em> calculates various bioclimatic indices from
monthly temperature and optional precipitation time series. The time
series can be averages for several years or monthly values for a
-specific year. In any case all 12 months must be provided. It a precipitation
-time series is not provided, only those indices based on temperature
-are calculated. The names of the output maps are <output>.bio01, <output>.bio02,
-<output>.bio03, etc.
+specific year. In any case all 12 months must be provided. It a
+precipitation time series is not provided, only those indices based on
+temperature are calculated. The names of the output maps are
+<output>bio01, <output>bio02, <output>bio03, etc. If
+the suffix bioXY needs to be separated from the <b>output</b> prefix,
+that separator must be part of the prefix, e.g. <i>output=eurolst_</i>.
<p>
If the input temperatures are scaled, e.g. as input = Celsius * 10, then
the <b>inscale</b> option must be set to 10. Similarly, the <b>outscale</b>
@@ -65,7 +67,7 @@
r.bioclim tmin=`g.list type=rast pat=tmin_* map=. sep=,` \
tmax=`g.list type=rast pat=tmax_* map=. sep=,` \
prec=`g.list type=rast pat=prec_* map=. sep=,` \
- out=worldclim workers=4
+ out=worldclim_ workers=4
</pre></div>
<h2>SEE ALSO</h2>
Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.py
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.py 2015-12-16 09:23:13 UTC (rev 67163)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.py 2015-12-16 09:34:18 UTC (rev 67164)
@@ -165,14 +165,14 @@
# BIO1 = Annual Mean Temperature
grass.message(_("BIO1 = Annual Mean Temperature ..."))
- output = outpre + '.bio01.' + str(pid)
+ output = outpre + 'bio01.' + str(pid)
grass.run_command('r.series', input = tavg, output = output, method = 'average')
grass.mapcalc("$bio = round(double($oscale) * $input / $iscale)",
- bio = outpre + '.bio01',
+ bio = outpre + 'bio01',
oscale = toutscale, input = output, iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio01',
+ 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('r.support', map = outpre + 'bio01',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = output, quiet = True);
# BIO2 = Mean Diurnal Range (Mean of monthly (max temp - min temp))
@@ -205,80 +205,80 @@
tr = tr.strip('\n')
- output = outpre + '.bio02.' + str(pid)
+ output = outpre + 'bio02.' + str(pid)
grass.run_command('r.series', input = tr, output = output, method = 'average')
grass.mapcalc("$bio = round(double($oscale) * $input / $iscale)",
- bio = outpre + '.bio02',
+ bio = outpre + 'bio02',
oscale = toutscale,
input = output,
iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio02',
+ 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('r.support', map = outpre + 'bio02',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = output, quiet = True);
grass.run_command('g.remove', flags = 'f', type = 'raster', pattern = '%s.tr??.%d' % (outpre, pid), quiet = True)
# BIO4 = Temperature Seasonality (standard deviation * 100)
grass.message(_("BIO4 = Temperature Seasonality ..."))
- output = outpre + '.bio04.' + str(pid)
+ output = outpre + 'bio04.' + str(pid)
grass.run_command('r.series', input = tavg, output = output, method = 'stddev')
grass.mapcalc("$bio = round(100.0 * $biotmp / $iscale * $oscale)",
- bio = outpre + '.bio04',
+ bio = outpre + 'bio04',
biotmp = output,
iscale = tinscale,
oscale = toutscale)
- grass.run_command('r.support', map = outpre + '.bio04',
+ 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('r.support', map = outpre + 'bio04',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = output, quiet = True);
# BIO5 = Max Temperature of Warmest Month
grass.message(_("BIO5 = Max Temperature of Warmest Month ..."))
- output = outpre + '.bio05.' + str(pid)
+ output = outpre + 'bio05.' + str(pid)
grass.run_command('r.series', input = tmax, output = output, method = 'maximum')
grass.mapcalc("$bio = round(double($oscale) * $biotmp / $iscale)",
- bio = outpre + '.bio05',
+ bio = outpre + 'bio05',
oscale = toutscale,
iscale = tinscale,
biotmp = output)
- grass.run_command('r.support', map = outpre + '.bio05',
+ 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('r.support', map = outpre + 'bio05',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = output, quiet = True);
# BIO6 = Min Temperature of Coldest Month
grass.message(_("BIO6 = Min Temperature of Coldest Month ..."))
- output = outpre + '.bio06.' + str(pid)
+ output = outpre + 'bio06.' + str(pid)
grass.run_command('r.series', input = tmin, output = output, method = 'minimum')
grass.mapcalc("$bio = round(double($oscale) * $biotmp / $iscale)",
- bio = outpre + '.bio06',
+ bio = outpre + 'bio06',
oscale = toutscale,
biotmp = output,
iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio06',
+ 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('r.support', map = outpre + 'bio06',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = output, quiet = True);
# BIO7 = Temperature Annual Range (BIO5-BIO6)
grass.message(_("BIO7 = Temperature Annual Range ..."))
grass.mapcalc("$bio = $bio5 - $bio6",
- bio = outpre + '.bio07',
- bio5 = outpre + '.bio05',
- bio6 = outpre + '.bio06')
- grass.run_command('r.support', map = outpre + '.bio07',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio07',history = os.environ['CMDLINE'])
# BIO3 = Isothermality (BIO2/BIO7) (* 100)
grass.message(_("BIO3 = Isothermality (BIO2/BIO7) ..."))
grass.mapcalc("$bio = round(100.0 * $bio2 / $bio7)",
- bio = outpre + '.bio03',
- bio2 = outpre + '.bio02',
- bio7 = outpre + '.bio07')
- grass.run_command('r.support', map = outpre + '.bio03',
+ 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'])
+ 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 ..."))
@@ -309,28 +309,28 @@
mapset= '.')
tavgq = tavgq.strip("\n")
- bio10 = outpre + '.bio10.' + str(pid)
- bio11 = outpre + '.bio11.' + str(pid)
+ bio10 = outpre + 'bio10.' + str(pid)
+ bio11 = outpre + 'bio11.' + str(pid)
grass.run_command('r.series', input = tavgq,
output = "%s,%s" % (bio10, bio11),
method = 'maximum,minimum')
grass.mapcalc("$bio = round(double($oscale) * $biotmp / $iscale)",
- bio = outpre + '.bio10',
+ bio = outpre + 'bio10',
oscale = toutscale,
biotmp = bio10,
iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio10',
+ 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 + 'bio10',history = os.environ['CMDLINE'])
grass.mapcalc("$bio = round(double($oscale) * $biotmp / $iscale)",
- bio = outpre + '.bio11',
+ bio = outpre + 'bio11',
oscale = toutscale,
biotmp = bio11,
iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio11',
+ 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('r.support', map = outpre + 'bio11',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster', name = "%s,%s" % (bio10, bio11), quiet = True);
@@ -392,7 +392,7 @@
if($wettestq == 2, $tavgq2, \
if($wettestq == 3, $tavgq3, null())))) \
* $oscale / $iscale)",
- bio = outpre + '.bio08',
+ bio = outpre + 'bio08',
wettestq = wettestq,
tavgq0 = tavgql[0], tavgq1 = tavgql[1],
tavgq2 = tavgql[2], tavgq3 = tavgql[3],
@@ -412,7 +412,7 @@
if($wettestq == 10, $tavgq10, \
if($wettestq == 11, $tavgq11, null())))))))))))) \
* $oscale / $iscale)",
- bio = outpre + '.bio08',
+ bio = outpre + 'bio08',
wettestq = wettestq,
tavgq0 = tavgql[0], tavgq1 = tavgql[1],
tavgq2 = tavgql[2], tavgq3 = tavgql[3],
@@ -422,9 +422,9 @@
tavgq10 = tavgql[10], tavgq11 = tavgql[11],
oscale = toutscale, iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio08',
+ 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'])
+ 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 ..."))
@@ -435,7 +435,7 @@
if($driestq == 2, $tavgq2, \
if($driestq == 3, $tavgq3, null())))) \
* $oscale / $iscale)",
- bio = outpre + '.bio09',
+ bio = outpre + 'bio09',
driestq = driestq,
tavgq0 = tavgql[0], tavgq1 = tavgql[1],
tavgq2 = tavgql[2], tavgq3 = tavgql[3],
@@ -455,7 +455,7 @@
if($driestq == 10, $tavgq10, \
if($driestq == 11, $tavgq11, null())))))))))))) \
* $oscale / $iscale)",
- bio = outpre + '.bio09',
+ bio = outpre + 'bio09',
driestq = driestq,
tavgq0 = tavgql[0], tavgq1 = tavgql[1],
tavgq2 = tavgql[2], tavgq3 = tavgql[3],
@@ -465,34 +465,34 @@
tavgq10 = tavgql[10], tavgq11 = tavgql[11],
oscale = toutscale, iscale = tinscale)
- grass.run_command('r.support', map = outpre + '.bio09',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio09',history = os.environ['CMDLINE'])
# BIO12 = Annual Precipitation
grass.message(_("BIO12 = Annual Precipitation ..."))
- output = outpre + '.bio12'
+ output = outpre + 'bio12'
grass.run_command('r.series', input = prec, output = output, method = 'sum')
- grass.run_command('r.support', map = outpre + '.bio12',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio12',history = os.environ['CMDLINE'])
# BIO13 = Precipitation of Wettest Month
# BIO14 = Precipitation of Driest Month
grass.message(_("BIO13 = Precipitation of Wettest Month,"))
grass.message(_("BIO14 = Precipitation of Driest Month ..."))
- bio13 = outpre + '.bio13'
- bio14 = outpre + '.bio14'
+ bio13 = outpre + 'bio13'
+ bio14 = outpre + 'bio14'
grass.run_command('r.series', input = prec,
output = "%s,%s" % (bio13, bio14),
method = 'maximum,minimum')
- grass.run_command('r.support', map = outpre + '.bio13',
+ 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',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio14',history = os.environ['CMDLINE'])
# BIO15 = Precipitation Seasonality (Coefficient of Variation)
@@ -503,29 +503,29 @@
output = "%s,%s" % (precavg, precstddev),
method = 'average,stddev')
grass.mapcalc("$bio = if($precavg == 0, 0, round(100.0 * $precstddev / $precavg))",
- bio = outpre + '.bio15',
+ bio = outpre + 'bio15',
precstddev = precstddev,
precavg = precavg)
- grass.run_command('r.support', map = outpre + '.bio15',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio15',history = os.environ['CMDLINE'])
# BIO16 = Precipitation of Wettest Quarter
# BIO17 = Precipitation of Driest Quarter
grass.message(_("BIO16 = Precipitation of Wettest Quarter,"))
grass.message(_("BIO17 = Precipitation of Driest Quarter ..."))
- bio16 = outpre + '.bio16'
- bio17 = outpre + '.bio17'
+ bio16 = outpre + 'bio16'
+ bio17 = outpre + 'bio17'
grass.run_command('r.series', input = precq,
output = "%s,%s" % (bio16, bio17),
method = 'maximum,minimum')
- grass.run_command('r.support', map = outpre + '.bio16',
+ 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',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio17',history = os.environ['CMDLINE'])
precql = precq.split(',')
@@ -537,7 +537,7 @@
if($warmestq == 1, $precq1, \
if($warmestq == 2, $precq2, \
if($warmestq == 3, $precq3, null())))))",
- bio = outpre + '.bio18',
+ bio = outpre + 'bio18',
warmestq = warmestq,
precq0 = precql[0], precq1 = precql[1],
precq2 = precql[2], precq3 = precql[3])
@@ -555,7 +555,7 @@
if($warmestq == 9, $precq9, \
if($warmestq == 10, $precq10, \
if($warmestq == 11, $precq11, null())))))))))))))",
- bio = outpre + '.bio18',
+ bio = outpre + 'bio18',
warmestq = warmestq,
precq0 = precql[0], precq1 = precql[1],
precq2 = precql[2], precq3 = precql[3],
@@ -564,9 +564,9 @@
precq8 = precql[8], precq9 = precql[9],
precq10 = precql[10], precq11 = precql[11])
- grass.run_command('r.support', map = outpre + '.bio18',
+ 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'])
+ grass.run_command('r.support', map = outpre + 'bio18',history = os.environ['CMDLINE'])
# BIO19 = Precipitation of Coldest Quarter
grass.message(_("BIO19 = Precipitation of Coldest Quarter ..."))
@@ -576,7 +576,7 @@
if($coldestq == 1, $precq1, \
if($coldestq == 2, $precq2, \
if($coldestq == 3, $precq3, null())))))",
- bio = outpre + '.bio19',
+ bio = outpre + 'bio19',
coldestq = coldestq,
precq0 = precql[0], precq1 = precql[1],
precq2 = precql[2], precq3 = precql[3])
@@ -594,7 +594,7 @@
if($coldestq == 9, $precq9, \
if($coldestq == 10, $precq10, \
if($coldestq == 11, $precq11, null())))))))))))))",
- bio = outpre + '.bio19',
+ bio = outpre + 'bio19',
coldestq = coldestq,
precq0 = precql[0], precq1 = precql[1],
precq2 = precql[2], precq3 = precql[3],
@@ -603,9 +603,9 @@
precq8 = precql[8], precq9 = precql[9],
precq10 = precql[10], precq11 = precql[11])
- grass.run_command('r.support', map = outpre + '.bio19',
+ 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('r.support', map = outpre + 'bio19',history = os.environ['CMDLINE'])
grass.run_command('g.remove', flags = 'f', type = 'raster',
pattern = tmp_pattern, quiet = True)
More information about the grass-commit
mailing list