Skip to content

Commit 2aab324

Browse files
Médéric RibreuxMédéric RIBREUX
Médéric Ribreux
authored and
Médéric RIBREUX
committed
Add i.aster.toar algorithm (need to fix a GRASS7 bug about number of files)
1 parent fe5c6f5 commit 2aab324

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
i.aster.toar
2+
Calculates Top of Atmosphere Radiance/Reflectance/Brightness Temperature from ASTER DN.
3+
Imagery (i.*)
4+
ParameterMultipleInput|input|Names of ASTER DN layers (15 layers)|3|False
5+
ParameterNumber|dayofyear|Day of Year of satellite overpass [0-366]|0|366|0|False
6+
ParameterNumber|sun_elevation|Sun elevation angle (degrees, < 90.0)|0.0|90.0|45.0|False
7+
ParameterBoolean|-r|Output is radiance (W/m2)|False
8+
ParameterBoolean|-a|VNIR is High Gain|False
9+
ParameterBoolean|-b|SWIR is High Gain|False
10+
ParameterBoolean|-c|VNIR is Low Gain 1|False
11+
ParameterBoolean|-d|SWIR is Low Gain 1|False
12+
ParameterBoolean|-e|SWIR is Low Gain 2|False
13+
OutputDirectory|output|Output Directory
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
i_aster_toar.py
6+
---------------
7+
Date : March 2016
8+
Copyright : (C) 2016 by Médéric Ribreux
9+
Email : medspx at medspx dot fr
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+
20+
__author__ = 'Médéric Ribreux'
21+
__date__ = 'March 2016'
22+
__copyright__ = '(C) 2016, Médéric Ribreux'
23+
24+
# This will get replaced with a git SHA1 when you do a git archive
25+
26+
__revision__ = '$Format:%H$'
27+
28+
from i import multipleOutputDir
29+
from processoing.core.parameters import getParameterFromString
30+
31+
32+
def processCommand(alg):
33+
# Remove output
34+
output = alg.getOutputFromName('output')
35+
alg.removeOutputFromName('output')
36+
37+
# Create output parameter
38+
param = getParameterFromString("ParameterString|output|output basename|None|False|False")
39+
param.value = alg.getTempFilename()
40+
alg.addParameter(param)
41+
42+
alg.processCommand()
43+
# re-add output
44+
alg.addOutput(output)
45+
46+
47+
def processOutputs(alg):
48+
param = alg.getParameterFromName('output')
49+
multipleOutputDir(alg, 'output', param.value)
50+
51+
# Delete output parameter
52+
alg.parameters.remove(param)

0 commit comments

Comments
 (0)