浏览代码

r.fillnulls: add lambda parameter of r.resamp.bspline (https://trac.osgeo.org/grass/ticket/1088) [news]

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68301 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 9 年之前
父节点
当前提交
2f5d7aaab1
共有 1 个文件被更改,包括 15 次插入3 次删除
  1. 15 3
      scripts/r.fillnulls/r.fillnulls.py

+ 15 - 3
scripts/r.fillnulls/r.fillnulls.py

@@ -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: