[GRASS-SVN] r68301 - grass/trunk/scripts/r.fillnulls
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Apr 22 08:02:05 PDT 2016
Author: wenzeslaus
Date: 2016-04-22 08:02:05 -0700 (Fri, 22 Apr 2016)
New Revision: 68301
Modified:
grass/trunk/scripts/r.fillnulls/r.fillnulls.py
Log:
r.fillnulls: add lambda parameter of r.resamp.bspline (#1088) [news]
Modified: grass/trunk/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/trunk/scripts/r.fillnulls/r.fillnulls.py 2016-04-22 07:17:28 UTC (rev 68300)
+++ grass/trunk/scripts/r.fillnulls/r.fillnulls.py 2016-04-22 15:02:05 UTC (rev 68301)
@@ -14,7 +14,7 @@
# PURPOSE: fills NULL (no data areas) in raster maps
# The script respects a user mask (MASK) if present.
#
-# COPYRIGHT: (C) 2001-2014 by the GRASS Development Team
+# COPYRIGHT: (C) 2001-2016 by the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
@@ -84,7 +84,18 @@
#% options : 2-10000
#% guisection: RST options
#%end
+#%option
+#% key: lambda
+#% type: double
+#% required: no
+#% multiple: no
+#% label: Tykhonov regularization parameter (affects smoothing)
+#% description: Used in bilinear and bicubic spline interpolation
+#% answer: 0.01
+#% guisection: Spline options
+#%end
+
import sys
import os
import atexit
@@ -119,6 +130,7 @@
edge = int(options['edge'])
segmax = int(options['segmax'])
npmin = int(options['npmin'])
+ lambda_ = float(options['lambda'])
quiet = True # FIXME
mapset = grass.gisenv()['MAPSET']
@@ -392,12 +404,12 @@
grass.run_command('r.resamp.bspline', input = input, mask = usermask,
output = prefix + 'filled', method = method,
ew_step = 3 * reg['ewres'], ns_step = 3 * reg['nsres'],
- lambda_ = 0.01, flags = 'n')
+ lambda_=lambda_, flags='n')
else:
grass.run_command('r.resamp.bspline', input = input,
output = prefix + 'filled', method = method,
ew_step = 3 * reg['ewres'], ns_step = 3 * reg['nsres'],
- lambda_ = 0.01, flags = 'n')
+ lambda_=lambda_, flags='n')
# restoring user's mask, if present:
if usermask:
More information about the grass-commit
mailing list