[GRASS-SVN] r69288 - grass-addons/grass7/imagery/i.landsat8.swlst
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 27 14:33:55 PDT 2016
Author: nikosa
Date: 2016-08-27 14:33:55 -0700 (Sat, 27 Aug 2016)
New Revision: 69288
Modified:
grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py
grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py
Log:
i.landsat8.swlst: Correctly deriving matrix of adjacent pixels
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-27 21:32:05 UTC (rev 69287)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/column_water_vapor.py 2016-08-27 21:33:55 UTC (rev 69288)
@@ -215,9 +215,15 @@
[ 0, -1] [ 0, 0] [ 0, 1]
[ 1, -1] [ 1, 0] [ 1, 1]
"""
- return [[col-1, row-1] for col in xrange(self.window_width)
- for row in xrange(self.window_height)]
+ # center row indexing
+ half_height = (self.window_height - 1) / 2
+ # center col indexing
+ half_width = (self.window_width - 1) / 2
+
+ return [[col, row] for col in xrange(-half_width + 1, half_width)
+ for row in xrange(-half_height + 1, half_height)]
+
def _derive_modifiers(self, tx):
"""
Return mapcalc map modifiers for adjacent pixels for the input map tx
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-27 21:32:05 UTC (rev 69287)
+++ grass-addons/grass7/imagery/i.landsat8.swlst/test_column_water_vapor.py 2016-08-27 21:33:55 UTC (rev 69288)
@@ -42,6 +42,7 @@
print
window_size = random_window_size()
+ # window_size = 7
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