Просмотр исходного кода

Optimisation: use one r.mapcalc pass instead of three

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33677 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 16 лет назад
Родитель
Сommit
3a580a9225
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      scripts/r.blend/r.blend.py

+ 6 - 1
scripts/r.blend/r.blend.py

@@ -81,9 +81,14 @@ def main():
 			    first = first, second = second,
 			    frac1 = frac1, frac2 = frac2)
     template = string.Template(s)
+    cmd = []
+    for ch in ['r','g','b']:
+	map = "%s.%s" % (output, ch)
+	cmd.append(template.substitute(ch = ch))
+    grass.run_command('r.mapcalc', expression = ';'.join(cmd))
+
     for ch in ['r','g','b']:
 	map = "%s.%s" % (output, ch)
-	grass.run_command('r.mapcalc', expr = template.substitute(ch = ch))
 	grass.run_command('r.colors', map = map, color = 'grey255')
 	grass.run_command('r.support', map = map,
 			  title = "Color blend of %s and %s" % (first, second), history="")