[GRASS-SVN] r71980 - in grass/branches/releasebranch_7_4/raster: . r.fill.stats r.fill.stats/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 26 19:26:34 PST 2017
Author: annakrat
Date: 2017-12-26 19:26:34 -0800 (Tue, 26 Dec 2017)
New Revision: 71980
Added:
grass/branches/releasebranch_7_4/raster/r.fill.stats/
Modified:
grass/branches/releasebranch_7_4/raster/Makefile
grass/branches/releasebranch_7_4/raster/r.fill.stats/main.c
grass/branches/releasebranch_7_4/raster/r.fill.stats/r.fill.stats.html
grass/branches/releasebranch_7_4/raster/r.fill.stats/testsuite/test_r_fill_stats.py
Log:
r.fill.stats: backport r71850, r71863, r71979
Modified: grass/branches/releasebranch_7_4/raster/Makefile
===================================================================
--- grass/branches/releasebranch_7_4/raster/Makefile 2017-12-27 03:08:24 UTC (rev 71979)
+++ grass/branches/releasebranch_7_4/raster/Makefile 2017-12-27 03:26:34 UTC (rev 71980)
@@ -22,6 +22,7 @@
r.external \
r.external.out \
r.fill.dir \
+ r.fill.stats \
r.flow \
r.geomorphon \
r.grow.distance \
Modified: grass/branches/releasebranch_7_4/raster/r.fill.stats/main.c
===================================================================
--- grass/trunk/raster/r.fill.stats/main.c 2017-11-26 22:30:03 UTC (rev 71850)
+++ grass/branches/releasebranch_7_4/raster/r.fill.stats/main.c 2017-12-27 03:26:34 UTC (rev 71980)
@@ -861,8 +861,8 @@
_("Interpret distance as map units, not number of cells");
parm.preserve = G_define_flag();
- parm.preserve->key = 'p';
- parm.preserve->label = _("Preserve original cell values");
+ parm.preserve->key = 'k';
+ parm.preserve->label = _("Keep (preserve) original cell values");
parm.preserve->description =
_("By default original values are smoothed");
Modified: grass/branches/releasebranch_7_4/raster/r.fill.stats/r.fill.stats.html
===================================================================
--- grass/trunk/raster/r.fill.stats/r.fill.stats.html 2017-11-26 22:30:03 UTC (rev 71850)
+++ grass/branches/releasebranch_7_4/raster/r.fill.stats/r.fill.stats.html 2017-12-27 03:26:34 UTC (rev 71980)
@@ -18,7 +18,7 @@
data and is often desirable, owing to noisy nature of high-resolution
sensor data. With dense data and small gaps, this should result in only slight
deviations from the original data and produce smooth output. Alternatively,
-setting the <b>-p</b> flag will disable the low-pass filter and preserve
+setting the <b>-k</b> flag will disable the low-pass filter and preserve
the original cell values.
<p>
@@ -156,7 +156,7 @@
<p>
-Unless the <b>-p</b> (preserve) flag is given, data cells of the input
+Unless the <b>-k</b> (keep) flag is given, data cells of the input
map will be replaced with interpolated values instead of preserving
them in the output. In modes "wmean" and "mean", this results in a
smoothing effect that includes the original data (see below)!
@@ -190,7 +190,7 @@
with different settings for <b>distance</b> and <b>power</b> might be required
to achieve good results. In some cases (e.g. when dealing with low-noise or
classified data), it might be desirable to turn off data smoothing by
-setting the <b>-p</b> (preserve) flag. This will ensure that the original
+setting the <b>-k</b> (keep) flag. This will ensure that the original
cell data is copied through to the result map without alteration.
<center>
@@ -201,7 +201,7 @@
Effect of smoothing the original data: The top row shows a gap-filled surface computed from a rasterized Lidar point
cloud (using <tt>mode=wmean</tt> and <tt>power=2</tt>), and the derived slope, aspect,
and profile curvature maps. The smoothing effect is clearly visible.
-The bottom row shows the effect of setting the <b>-p</b> flag: Preserving the original
+The bottom row shows the effect of setting the <b>-k</b> flag: Preserving the original
cell values in the interpolated output produces and unsmoothed, noisy surface, and likewise
noisy derivative maps.
</em></p>
@@ -213,7 +213,7 @@
uses a window (kernel) for computations that considers only the
immediate neighborhood of each cell. When performed on noisy data,
such local operations result in equally noisy derivatives if the
-original data is preserved (by setting the <b>-p</b> flag) and no smoothing
+original data is preserved (by setting the <b>-k</b> flag) and no smoothing
is performed.
<p>
@@ -231,12 +231,12 @@
r.in.lidar input=points.las output=ground method=mean class_filter=2
r.fill.stats input=ground output=ground_filled mode=wmean power=2.0 cells=8
-r.fill.stats -p input=ground output=ground_filled2 mode=wmean power=2.0 cells=8
+r.fill.stats -k input=ground output=ground_filled2 mode=wmean power=2.0 cells=8
r.slope.aspect elevation=ground_filled slope=slope aspect=aspect pcurvature=pcur tcurvature=tcur
r.slope.aspect elevation=ground_filled2 slope=slope2 aspect=aspect2 pcurvature=pcur2 tcurvature=tcur2
-g.region n=219537 s=219172 w=636852 e=637218 -p
+g.region n=219537 s=219172 w=636852 e=637218 -k
d.mon cairo output=r_fill_gaps_smoothing.png width=1464 height=730
export GRASS_FONT=LiberationSans-Regular
@@ -385,7 +385,7 @@
Fill data gaps in a categorized raster map; preserve existing data:
<div class="code"><pre>
-r.fill.stats input=categories output=result dist=100 -m mode=mode -p
+r.fill.stats input=categories output=result dist=100 -m mode=mode -k
</pre></div>
<h3>Lidar point cloud example</h3>
Modified: grass/branches/releasebranch_7_4/raster/r.fill.stats/testsuite/test_r_fill_stats.py
===================================================================
--- grass/trunk/raster/r.fill.stats/testsuite/test_r_fill_stats.py 2017-11-26 22:30:03 UTC (rev 71850)
+++ grass/branches/releasebranch_7_4/raster/r.fill.stats/testsuite/test_r_fill_stats.py 2017-12-27 03:26:34 UTC (rev 71980)
@@ -30,13 +30,13 @@
def test_stats(self):
"""Test if results match verified rasters"""
- self.assertModule('r.fill.gaps', input=self.ascii, output=self.stats, distance=1, mode='wmean', power=2, cells=2, overwrite=True)
+ self.assertModule('r.fill.stats', input=self.ascii, output=self.stats, distance=1, mode='wmean', power=2, cells=2, overwrite=True)
self.assertRastersNoDifference(self.stats, self.wmean, precision=1e-6)
- self.assertModule('r.fill.gaps', input=self.ascii, output=self.stats, distance=1, mode='mean', power=2, cells=2, overwrite=True)
+ self.assertModule('r.fill.stats', input=self.ascii, output=self.stats, distance=1, mode='mean', power=2, cells=2, overwrite=True)
self.assertRastersNoDifference(self.stats, self.mean, precision=1e-6)
- self.assertModule('r.fill.gaps', input=self.ascii, output=self.stats, distance=1, mode='median', power=2, cells=2, overwrite=True)
+ self.assertModule('r.fill.stats', input=self.ascii, output=self.stats, distance=1, mode='median', power=2, cells=2, overwrite=True)
self.assertRastersNoDifference(self.stats, self.median, precision=1e-6)
- self.assertModule('r.fill.gaps', input=self.ascii, output=self.stats, distance=1, mode='mode', power=2, cells=2, overwrite=True)
+ self.assertModule('r.fill.stats', input=self.ascii, output=self.stats, distance=1, mode='mode', power=2, cells=2, overwrite=True)
self.assertRastersNoDifference(self.stats, self.mode, precision=1e-6)
if __name__ == '__main__':
More information about the grass-commit
mailing list