Skip to content

Commit 59b1d8d

Browse files
committed
modified grass postprocessing and edited grass description
1 parent d5db373 commit 59b1d8d

File tree

15 files changed

+108
-108
lines changed

15 files changed

+108
-108
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
r.neighbors
22
r.neighbors - Makes each cell category value a function of the category values assigned to the cells around it, and stores new cell values in an output raster map layer.
33
Raster (r.*)
4-
ParameterRaster|input|Name of input raster map|False
4+
ParameterRaster|input|Input raster layer|False
55
ParameterSelection|method|Neighborhood operation|average;median;mode;minimum;maximum;stddev;sum;variance;diversity;interspersion
6-
ParameterNumber|size|Neighborhood size|1.0|None|3
6+
ParameterNumber|size|Neighborhood size|1|None|3
77
ParameterBoolean|-c|Use circular neighborhood|False
88
*ParameterBoolean|-a|Do not align output with the input|False
99
*ParameterFile|weight|File containing weights|False
10-
OutputRaster|output|Name for output raster map
10+
OutputRaster|output|Output layer

python/plugins/sextante/grass/description/r.quant.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ParameterRaster|basemap|Base map to take quant rules from|False
66
ParameterRange|fprange|Floating point range: dmin,dmax|0,1
77
ParameterRange|range|Integer range: min,max|1,255
88
ParameterBoolean|-t|Truncate floating point data|False
9-
ParameterBoolean|-r|Round floating point data|False
9+
ParameterBoolean|-r|Round floating point data|False

python/plugins/sextante/grass/description/r.quantile.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ r.quantile
22
r.quantile - Compute quantiles using two passes.
33
Raster (r.*)
44
ParameterRaster|input|Name of input raster map|False
5-
ParameterNumber|quantiles|Number of quantiles|2.0|None|4
6-
ParameterString|percentiles|List of percentiles|
7-
ParameterBoolean|-r|Generate recode rules based on quantile-defined intervals|False
5+
ParameterNumber|quantiles|Number of quantiles|2|None|4
6+
*ParameterBoolean|-r|Generate recode rules based on quantile-defined intervals|False
7+
OutputHTML|html|Output report
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
HtmlReportPostProcessor.py
6+
---------------------
7+
Date : December 2012
8+
Copyright : (C) 2012 by Victor Olaya
9+
Email : volayaf at gmail dot com
10+
***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************
18+
"""
19+
__author__ = 'Victor Olaya'
20+
__date__ = 'December 2012'
21+
__copyright__ = '(C) 2012, Victor Olaya'
22+
# This will get replaced with a git SHA1 when you do a git archive
23+
__revision__ = '$Format:%H$'
24+
25+
def postProcessResults(alg):
26+
htmlFile = alg.getOutputFromName('html').value
27+
grassName = alg.grassName
28+
found = False
29+
f = open(htmlFile, "w")
30+
f.write("<h2>" + grassName + "</h2>\n")
31+
for line in alg.consoleOutput:
32+
if found and not line.strip().endswith('exit'):
33+
f.write(line + "<br>\n")
34+
if grassName in line and not line.startswith("GRASS"):
35+
found = True
36+
f.close()
37+

python/plugins/sextante/grass/ext/r_coin.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,15 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
1920
__author__ = 'Victor Olaya'
2021
__date__ = 'December 2012'
2122
__copyright__ = '(C) 2012, Victor Olaya'
2223
# This will get replaced with a git SHA1 when you do a git archive
2324
__revision__ = '$Format:%H$'
2425

26+
from sextante.grass.ext import HtmlReportPostProcessor
27+
2528
def postProcessResults(alg):
26-
htmlFile = alg.getOutputFromName('html').value
27-
found = False
28-
f = open(htmlFile, "w")
29-
f.write("<h2>r.coin</h2>\n")
30-
for line in alg.consoleOutput:
31-
if found and not line.strip().endswith('exit'):
32-
f.write(line + "<br>\n")
33-
if 'r.coin' in line:
34-
found = True
35-
f.close()
29+
HtmlReportPostProcessor.postProcessResults(alg)
3630

python/plugins/sextante/grass/ext/r_covar.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,10 @@
2222
# This will get replaced with a git SHA1 when you do a git archive
2323
__revision__ = '$Format:%H$'
2424

25+
26+
from sextante.grass.ext import HtmlReportPostProcessor
27+
2528
def postProcessResults(alg):
26-
htmlFile = alg.getOutputFromName('html').value
27-
found = False
28-
f = open(htmlFile, "w")
29-
f.write("<h2>r.covar</h2>\n")
30-
for line in alg.consoleOutput:
31-
if found and not line.strip().endswith('exit'):
32-
f.write(line + "<br>\n")
33-
if 'r.covar' in line:
34-
found = True
35-
f.close()
29+
HtmlReportPostProcessor.postProcessResults(alg)
30+
3631

python/plugins/sextante/grass/ext/r_describe.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,8 @@
2222
# This will get replaced with a git SHA1 when you do a git archive
2323
__revision__ = '$Format:%H$'
2424

25+
from sextante.grass.ext import HtmlReportPostProcessor
26+
2527
def postProcessResults(alg):
26-
htmlFile = alg.getOutputFromName('html').value
27-
found = False
28-
f = open(htmlFile, "w")
29-
f.write("<h2>r.describe</h2>\n")
30-
for line in alg.consoleOutput:
31-
if found and not line.strip().endswith('exit'):
32-
f.write(line + "<br>\n")
33-
if 'r.describe' in line:
34-
found = True
35-
f.close()
28+
HtmlReportPostProcessor.postProcessResults(alg)
3629

python/plugins/sextante/grass/ext/r_info.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,8 @@
2222
# This will get replaced with a git SHA1 when you do a git archive
2323
__revision__ = '$Format:%H$'
2424

25+
from sextante.grass.ext import HtmlReportPostProcessor
26+
2527
def postProcessResults(alg):
26-
htmlFile = alg.getOutputFromName('html').value
27-
found = False
28-
f = open(htmlFile, "w")
29-
f.write("<h2>r.info</h2>\n")
30-
for line in alg.consoleOutput:
31-
if found and not line.strip().endswith('exit'):
32-
f.write(line + "<br>\n")
33-
if 'r.info' in line:
34-
found = True
35-
f.close()
28+
HtmlReportPostProcessor.postProcessResults(alg)
3629

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
r_quantile.py
6+
---------------------
7+
Date : December 2012
8+
Copyright : (C) 2012 by Victor Olaya
9+
Email : volayaf at gmail dot com
10+
***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************
18+
"""
19+
__author__ = 'Victor Olaya'
20+
__date__ = 'December 2012'
21+
__copyright__ = '(C) 2012, Victor Olaya'
22+
# This will get replaced with a git SHA1 when you do a git archive
23+
__revision__ = '$Format:%H$'
24+
25+
from sextante.grass.ext import HtmlReportPostProcessor
26+
27+
def postProcessResults(alg):
28+
HtmlReportPostProcessor.postProcessResults(alg)
29+

python/plugins/sextante/grass/ext/r_regression_line.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@
2222
# This will get replaced with a git SHA1 when you do a git archive
2323
__revision__ = '$Format:%H$'
2424

25+
from sextante.grass.ext import HtmlReportPostProcessor
26+
2527
def postProcessResults(alg):
26-
htmlFile = alg.getOutputFromName('html').value
27-
found = False
28-
f = open(htmlFile, "w")
29-
f.write("<h2>r.regresion.line</h2>\n")
30-
for line in alg.consoleOutput:
31-
if found and not line.strip().endswith('exit'):
32-
f.write(line + "<br>\n")
33-
if 'r.regression.line' in line:
34-
found = True
35-
f.close()
28+
HtmlReportPostProcessor.postProcessResults(alg)
29+
3630

0 commit comments

Comments
 (0)