Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add i.topo.corr algorithm
- Loading branch information
Médéric Ribreux
authored and
Médéric RIBREUX
committed
May 29, 2016
1 parent
cce451c
commit 5182748
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
python/plugins/processing/algs/grass7/description/i.topo.corr.ill.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,8 @@ | ||
i.topo.corr | ||
i.topo.coor.ill - Creates illumination model for topographic correction of reflectance. | ||
Imagery (i.*) | ||
ParameterRaster|basemap|Name of elevation raster map|False | ||
ParameterNumber|zenith|Solar zenith in degrees|0.0|360.0|0.0|False | ||
ParameterNumber|azimuth|Solar azimuth in degrees|0.0|360.0|0.0|False | ||
Hardcoded|-i | ||
OutputRaster|output|Illumination Model |
9 changes: 9 additions & 0 deletions
9
python/plugins/processing/algs/grass7/description/i.topo.corr.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 @@ | ||
i.topo.corr | ||
Computes topographic correction of reflectance. | ||
Imagery (i.*) | ||
ParameterMultipleInput|input|Name of reflectance raster maps to be corrected topographically|3|False | ||
ParameterRaster|basemap|Name of illumination input base raster map|False | ||
ParameterNumber|zenith|Solar zenith in degrees|0.0|360.0|0.0|False | ||
ParameterSelection|method|Topographic correction method|cosine;minnaert;c-factor;percent|0 | ||
*ParameterBoolean|-s|Scale output to input and copy color rules|False | ||
OutputDirectory|output|Output Directory |
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,52 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
i_topo_corr.py | ||
-------------- | ||
Date : April 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__ = 'April 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$' | ||
|
||
from i import multipleOutputDir, verifyRasterNum | ||
from processing.core.parameters import getParameterFromString | ||
|
||
|
||
def processCommand(alg): | ||
# Remove output | ||
output = alg.getOutputFromName('output') | ||
alg.removeOutputFromName('output') | ||
|
||
# Create output parameter | ||
param = getParameterFromString("ParameterString|output|output basename|None|False|False") | ||
param.value = alg.getTempFilename() | ||
alg.addParameter(param) | ||
|
||
alg.processCommand() | ||
# re-add output | ||
alg.addOutput(output) | ||
|
||
|
||
def processOutputs(alg): | ||
param = alg.getParameterFromName('output') | ||
multipleOutputDir(alg, 'output', param.value) | ||
|
||
# Delete output parameter | ||
alg.parameters.remove(param) |