|
@@ -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,6 +84,17 @@
|
|
|
#% 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
|
|
@@ -119,6 +130,7 @@ def main():
|
|
|
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 @@ def main():
|
|
|
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:
|