Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Médéric RIBREUX
committed
Feb 28, 2016
1 parent
6673fe3
commit 6b9f9d4
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/grass7/description/r.topmodel.topidxstats.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
r.topmodel | ||
r.topmodel.topidxstats - Builds a TOPMODEL topographic index statistics file. | ||
Raster (r.*) | ||
ParameterRaster|topidx|Name of input topographic index raster map|False | ||
ParameterNumber|ntopidxclasses|Number of topographic index classes|0|None|30|True | ||
Hardcoded|-p | ||
OutputFile|outtopidxstats|TOPMODEL topographic index statistics file |
9 changes: 9 additions & 0 deletions
9
python/plugins/processing/algs/grass7/description/r.topmodel.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
r.topmodel | ||
Simulates TOPMODEL which is a physically based hydrologic model. | ||
Raster (r.*) | ||
ParameterFile|parameters|Name of TOPMODEL parameters file|False|False | ||
ParameterFile|topidxstats|Name of topographic index statistics file|False|False | ||
ParameterFile|input|Name of rainfall and potential evapotranspiration data file|False|False | ||
ParameterString|timestep|Time step. Generate output for this time step|None|False|True | ||
ParameterString|topidxclass|Topographic index class. Generate output for this topographic index class|None|False|True | ||
OutputFile|output|TOPMODEL output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
r_topmodel.py | ||
------------- | ||
Date : February 2016 | ||
Copyright : (C) 2016 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'February 2016' | ||
__copyright__ = '(C) 2016, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
|
||
def processCommand(alg): | ||
# We temporary remove the output | ||
out = alg.getOutputFromName('out') | ||
topidx = alg.getParameterValue('topidx') | ||
command = "r.topmodel parameters=\"{}\" topidxstats=\"{}\" input=\"{}\" output=\"{}\" {} {}--overwrite".format( | ||
alg.getParameterValue('parameters'), | ||
alg.getParameterValue('topidxstats'), | ||
alg.getParameterValue('input'), | ||
alg.getOutputValue('output'), | ||
'timestep={}'.format(alg.getParameterValue('timestep')) if alg.getParameterValue('timestep') else '', | ||
'topidxclass={}'.format(alg.getParameterValue('topidxclass')) if alg.getParameterValue('topidxclass') else '' | ||
) | ||
alg.commands.append(command) | ||
|
39 changes: 39 additions & 0 deletions
39
python/plugins/processing/algs/grass7/ext/r_topmodel_topidxstats.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
r_topmodel_topidxstats.py | ||
------------------------- | ||
Date : February 2016 | ||
Copyright : (C) 2016 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'February 2016' | ||
__copyright__ = '(C) 2016, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
|
||
def processCommand(alg): | ||
# We temporary remove the output | ||
out = alg.getOutputFromName('outtopidxstats') | ||
topidx = alg.getParameterValue('topidx') | ||
command = "r.topmodel -p topidx={} ntopidxclasses={} outtopidxstats={} --overwrite".format( | ||
alg.exportedLayers[topidx], | ||
alg.getParameterValue('ntopidxclasses'), | ||
out.value | ||
) | ||
alg.commands.append(command) | ||
|