Skip to content
Permalink
Browse files

Add i.topo.corr algorithm

  • Loading branch information
Médéric Ribreux Médéric RIBREUX
Médéric Ribreux authored and Médéric RIBREUX committed May 2, 2016
1 parent cce451c commit 5182748e103fa12989371ed04adfb45ee775d597
@@ -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
@@ -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
@@ -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)

0 comments on commit 5182748

Please sign in to comment.
You can’t perform that action at this time.