Add i.topo.corr algorithm

This commit is contained in:
Médéric Ribreux 2016-05-02 15:54:11 +02:00 committed by Médéric RIBREUX
parent cce451c722
commit 5182748e10
3 changed files with 69 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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)