[GRASS-SVN] r69212 - grass-addons/grass7/imagery/i.landsat8.swlst
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 22 07:45:32 PDT 2016
Author: nikosa
Date: 2016-08-22 07:45:32 -0700 (Mon, 22 Aug 2016)
New Revision: 69212
Modified:
grass-addons/grass7/imagery/i.landsat8.swlst/README.md
grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py
grass-addons/grass7/imagery/i.landsat8.swlst/i.landsat8.swlst.py
grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py
Log:
i.landsat8.swlst: updates of minor importance
Modified: grass-addons/grass7/imagery/i.landsat8.swlst/README.md
===================================================================
--- grass-addons/grass7/imagery/i.landsat8.swlst/README.md 2016-08-22 14:33:16 UTC (rev 69211)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/README.md 2016-08-22 14:45:32 UTC (rev 69212)
@@ -1,4 +1,4 @@
-*i.landsat8.swlst* is a GRASS GIS add-on, implementating a practical Slit-Window (SW)
+*i.landsat8.swlst* is a GRASS GIS add-on, implementating a practical Split-Window (SW)
algorithm, estimating land surface temperature (LST), from the Thermal Infra-Red
Sensor (TIRS) aboard Landsat 8 with an accuracy of better than 1.0 K.
Modified: grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py
===================================================================
--- grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py 2016-08-22 14:33:16 UTC (rev 69211)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py 2016-08-22 14:45:32 UTC (rev 69212)
@@ -126,7 +126,7 @@
# window of N (= n by n) pixels, adjacent pixels
assert window_size % 2 != 0, "Window size should be an even number!"
- assert window_size >= 7, "Window size should be larger than 5"
+ assert window_size >= 7, "Window size should be equal to/larger than 7."
self.window_size = window_size
self.window_height = self.window_size
@@ -163,7 +163,9 @@
"""
The object's self string
"""
- msg = 'Expression for r.mapcalc to determine column water vapor: '
+ msg = '- Window size: ' + str(self.window_size) + " by " + str(self.window_size)
+ msg += '\n'
+ msg += ' - Expression for r.mapcalc to determine column water vapor: '
return msg + str(self.column_water_vapor_expression)
def compute_column_water_vapor(self, tik, tjk):
Modified: grass-addons/grass7/imagery/i.landsat8.swlst/i.landsat8.swlst.py
===================================================================
--- grass-addons/grass7/imagery/i.landsat8.swlst/i.landsat8.swlst.py 2016-08-22 14:33:16 UTC (rev 69211)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/i.landsat8.swlst.py 2016-08-22 14:45:32 UTC (rev 69212)
@@ -1041,7 +1041,8 @@
# flags
global info, null
info = flags['i']
- keep_region = flags['k']
+ # keep_region = flags['k']
+ scene_extent = flags['k']
timestamping = flags['t']
null = flags['n']
@@ -1056,7 +1057,8 @@
#
# Set Region
- if not keep_region:
+ # if not keep_region:
+ if scene_extent:
grass.use_temp_region() # safely modify the region
msg = "\n|! Matching region extent to map {name}"
@@ -1073,7 +1075,8 @@
g.message(msg)
- elif keep_region:
+ # elif keep_region:
+ elif scene_extent:
grass.warning(_('Operating on current region'))
#
@@ -1240,7 +1243,8 @@
#run("g.rename", rast=(tmp_lst, lst_output))
# restore region
- if not keep_region:
+ # if not keep_region:
+ if scene_extent:
grass.del_temp_region() # restoring previous region settings
g.message("|! Original Region restored")
Modified: grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py
===================================================================
--- grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py 2016-08-22 14:33:16 UTC (rev 69211)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py 2016-08-22 14:45:32 UTC (rev 69212)
@@ -11,6 +11,11 @@
# helper functions
+def random_window_size():
+ """
+ """
+ return random.randint(7, 21)
+
def random_adjacent_pixel_values(pixel_modifiers):
"""
"""
@@ -36,7 +41,8 @@
print "Testing the Column_Water_Vapor class"
print
- obj = Column_Water_Vapor(3, 'A', 'B')
+ window_size = random_window_size()
+ obj = Column_Water_Vapor(window_size, 'A', 'B')
print " | Testing the '__str__' method:\n\n ", obj
print
More information about the grass-commit
mailing list