浏览代码

v.krige remove from core distribution (see https://trac.osgeo.org/grass/ticket/3136 for details)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69397 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 年之前
父节点
当前提交
6e9fecbe81

+ 1 - 2
gui/wxpython/core/gconsole.py

@@ -534,8 +534,7 @@ class GConsole(wx.EvtHandler):
 
                     # no arguments given
                     if hasParams and \
-                       not isinstance(self._guiparent, FormNotebook) and \
-                       command[0] != 'v.krige':
+                       not isinstance(self._guiparent, FormNotebook):
                         # also parent must be checked, see #3135 for details
                         try:
                             GUI(parent=self._guiparent,

+ 1 - 1
gui/wxpython/lmgr/frame.py

@@ -861,7 +861,7 @@ class GMFrame(wx.Frame):
 
         # check list of dummy commands for GUI modules that do not have GRASS
         # bin modules or scripts.
-        if cmd in ['vcolors', 'r.mapcalc', 'r3.mapcalc', 'v.krige']:
+        if cmd in ['vcolors', 'r.mapcalc', 'r3.mapcalc']:
             return cmdlist
 
         try:

+ 0 - 2
gui/wxpython/xml/toolboxes.xml

@@ -1039,8 +1039,6 @@
         <label>Raster series interpolation</label> 
       </module-item> 
       <separator/>
-      <wxgui-item name="OrdinaryOrBlockKriging"/>
-      <separator/>
       <module-item name="r.fillnulls">
         <label>Fill NULL cells</label>
       </module-item>

+ 0 - 6
gui/wxpython/xml/wxgui_items.xml

@@ -334,12 +334,6 @@
     <description>Configuration editor for r.li.'index'</description>
     <keywords>raster,landscape structure analysis</keywords>
   </wxgui-item>
-  <wxgui-item name="OrdinaryOrBlockKriging">
-    <label>Ordinary or block kriging</label>
-    <command>v.krige</command>
-    <description>Performs ordinary or block kriging.</description>
-    <keywords>vector,raster,interpolation,kriging</keywords>
-  </wxgui-item>
   <wxgui-item name="CreateNewVectorMap">
     <label>Create new vector map</label>
     <handler>OnNewVector</handler>

+ 1 - 2
scripts/Makefile

@@ -75,8 +75,7 @@ SUBDIRS = \
 	v.unpack \
 	v.what.strds \
 	v.what.vect \
-	wxpyimgview \
-	v.krige
+	wxpyimgview
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 

+ 0 - 7
scripts/v.krige/Makefile

@@ -1,7 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = v.krige
-
-include $(MODULE_TOPDIR)/include/Make/Script.make
-
-default: script

+ 0 - 200
scripts/v.krige/v.krige.html

@@ -1,200 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>v.krige</em> allows performing Kriging operations in GRASS GIS
-environment, using R software functions in background.
-
-
-<h2>NOTES</h2>
-
-<em>v.krige</em> is just a front-end to R. The options and parameters
-are the same offered by packages <i>automap</i> and <i>gstat</i>.
-
-<p>Kriging, like other interpolation methods, is fully dependent on input
-data features. Exploratory analysis of data is encouraged to find out
-outliers, trends, anisotropies, uneven distributions and consequently
-choose the kriging algorithm that will give the most acceptable
-result. Good knowledge of the dataset is more valuable than hundreds
-of parameters or powerful hardware. See Isaaks and Srivastava's book,
-exhaustive and clear even if a bit outdated.
-
-<p>Auto-fit variogram option will update sill, nugget, range and kappa values
-with fitted ones. Enabling the values will pass them to auto-fit and thus
-preserve from modification and thus they might differ from fitted ones.
-
-<h3>Dependencies</h3>
-
-<dl>
-<dt><b>R software >= 2.x</b></dt>
-<dd></dd>
-
-<dt><b>rpy2</b></dt>
-<dd>Python binding to R. Note! <tt>rpy</tt> version 1 is not supported.</dd>
-
-<dt><b>R packages automap, gstat, rgrass7 and rgeos. </b></dt>
-<dd>automap is optional (provides automatic variogram fit).</dd>
-</dl>
-
-Install the packages via R command line (or your preferred GUI):
-<div class="code"><pre>
-  install.packages("rgeos", dep=T)
-  install.packages("gstat", dep=T)
-  install.packages("rgrass7", dep=T)
-  install.packages("automap", dep=T)
-</pre></div>
-
-<h4>Notes for Debian GNU/Linux</h4>
-
-Install the dependiencies. <b>Attention! python-rpy IS NOT
-SUITABLE.</b>:
-
-<div class="code"><pre>
-  aptitude install R python-rpy2
-</pre></div>
-
-To install R packages, use either R's functions listed above (as root or as user),
-either the Debian packages [5], add to repositories' list
-for 32bit or 64bit (pick up the suitable line):
-
-<div class="code"><pre>
-  deb <a href="http://debian.cran.r-project.org/cran2deb/debian-i386">http://debian.cran.r-project.org/cran2deb/debian-i386</a> testing/
-  deb <a href="http://debian.cran.r-project.org/cran2deb/debian-amd64">http://debian.cran.r-project.org/cran2deb/debian-amd64</a> testing/
-</pre></div>
-
-and get the packages via aptitude:
-
-<div class="code"><pre>
-  aptitude install r-cran-gstat r-cran-rgrass7
-</pre></div>
-
-<h4>Notes for Windows</h4>
-
-<!-- this is probably the wrong place -->
-
-Compile GRASS GIS following this
-<a href="http://trac.osgeo.org/grass/wiki/CompileOnWindows">guide</a>.
-You could also use Linux in a virtual machine. Or install Linux in a
-separate partition of the HD. This is not as painful as it appears,
-there are lots of guides over the Internet to help you.
-
-<h3>Computation time issues</h3>
-
-Please note that although high number of input data points and/or high 
-region resolution contribute to a better output, both will also slow down
-the kriging calculation.
-
-<h2>EXAMPLES</h2>
-
-Kriging example based on elevation map (Spearfish data set).
-
-<p><b>Part 1: random sampling</b> of 2000 vector points from known
-elevation map. Each point will receive the elevation value from the
-elevation raster, as if it came from a point survey.
-
-<div class="code"><pre>
-# reduce resolution for this example
-g.region raster=elevation -p res=100
-v.random output=rand2k_elev npoints=2000
-v.db.addtable map=rand2k_elev columns="elevation double precision"
-v.what.rast map=rand2k_elev raster=elevation column=elevation
-</pre></div>
-
-<b>Part 2: remove points lacking elevation attributes</b>. Points
-sampled at the border of the elevation map didn't receive any
-value. v.krige has no preferred action to cope with no data values, so
-the user must check for them and decide what to do (remove points,
-fill with the value of the nearest point, fill with the global/local
-mean...). In the following line of code, points with no data are
-removed from the map.
-
-<div class="code"><pre>
-v.extract input=rand2k_elev output=rand2k_elev_filt where="elevation not NULL"
-</pre></div>
-
-Check the result of previous line ("number of NULL attributes" must be
-0):
-
-<div class="code"><pre>
-v.univar map=rand2k_elev_filt type=point column=elevation
-</pre></div>
-
-<b>Part 3: reconstruct DEM through kriging</b>. The simplest way to run 
-<em>v.krige</em> from CLI is using automatic variogram fit (note:
-requires R's automap package). Output map name is optional, the
-modules creates it automatically appending "_kriging" to the input
-map name and also checks for overwrite. If output_var is specified,
-the variance map is also created. Automatic variogram fit is provided
-by R package automap. The variogram models tested by the fitting
-functions are: exponential, spherical, Gaussian, Matern, M.Stein's
-parametrisation. A wider range of models is available from gstat
-package and can be tested on the GUI via the variogram plotting. If a
-model is specified in the CLI, also sill, nugget and range values are
-to be provided, otherwise an error is raised (see second example of
-<em>v.krige</em> command).
-
-<div class="code"><pre>
-# automatic variogram fit
-v.krige input=rand2k_elev_filt column=elevation \
-        output=rand2k_elev_kriging output_var=rand2k_elev_kriging_var
-
-# define variogram model, create variance map as well
-v.krige input=rand2k_elev_filt column=elevation \
-        output=rand2k_elev_filt_kriging output_var=rand2k_elev_filt_kriging_var \
-        model=Mat sill=2500 nugget=0 range=1000 
-</pre></div>
-
-Or run wxGUI, to interactively fit the variogram and explore options:
-
-<div class="code"><pre>
-v.krige
-</pre></div>
-
-<b>Calculate prediction error</b>:
-
-<div class="code"><pre>
-r.mapcalc "rand2k_elev_kriging_pe = sqrt(rand2k_elev_kriging_var)"
-r.univar map=elevation
-r.univar map=rand2k_elev_kriging
-r.univar map=rand2k_elev_kriging_pe
-</pre></div>
-
-The results show high errors, as the kriging techniques (ordinary and
-block kriging) are unable to handle a dataset with a trend, like the
-one used in this example: elevation is higher in the southwest corner
-and lower on northeast corner. Universal kriging can give far better
-results in these cases as it can handle the trend. It is available in
-R package gstat and will be part in a future v.krige release.
-
-
-<h2>SEE ALSO</h2>
-
-R package <a href="http://cran.r-project.org/web/packages/gstat/index.html">gstat</a>,
-maintained by Edzer J. Pebesma and others
-
-<p>
-R
-package <a href="http://cran.r-project.org/web/packages/rgrass7/index.html">rgrass7</a>,
-maintained by Roger Bivand
-
-<p>
-The <a href="http://grasswiki.osgeo.org/wiki/R_statistics">Short
-Introduction to Geostatistical and Spatial Data Analysis with GRASS GIS
-and R statistical data language</a> at the GRASS Wiki (includes
-installation tips). It contains a subsection about <b>rgrass7</b>.
-
-<p>
-v.krige's <a href="http://grasswiki.osgeo.org/wiki/V.krige_GSoC_2009">wiki page</a>
-
-<p>
-Overview: <a href="https://grasswiki.osgeo.org/wiki/Interpolation">Interpolation and Resampling</a> in GRASS GIS
-
-<h2>REFERENCES</h2>
-
-Isaaks and Srivastava, 1989: "An Introduction to Applied Geostatistics"
- (ISBN 0-19-505013-4) 
-
-
-<h2>AUTHOR</h2>
-
-Anne Ghisla, Google Summer of Code 2009
-
-<p><i>Last changed: $Date$</i>

+ 0 - 457
scripts/v.krige/v.krige.py

@@ -1,457 +0,0 @@
-#!/usr/bin/env python
-"""
-MODULE:    v.krige
-
-AUTHOR(S): Anne Ghisla <a.ghisla AT gmail.com>
-
-PURPOSE:   Performs ordinary or block kriging
-
-DEPENDS:   R 2.x, packages gstat, maptools and rgrass7, optional: automap
-
-COPYRIGHT: (C) 2009-2014 the GRASS Development Team
-
-This program is free software under the GNU General Public
-License (>=v2). Read the file COPYING that comes with GRASS
-for details.
-"""
-
-# g.parser information
-
-#%module
-#% description: Performs ordinary or block kriging for vector maps.
-#% keyword: vector
-#% keyword: interpolation
-#% keyword: raster
-#% keyword: kriging
-#%end
-
-#%option G_OPT_V_INPUT
-#% description: Name of point vector map containing sample data
-#%end
-#%option G_OPT_DB_COLUMN
-#% description: Name of attribute column with numerical value to be interpolated
-#% required: yes
-#%end
-#%option G_OPT_R_OUTPUT
-#% label: Name for output raster map
-#% description: If omitted, will be <input name>_kriging
-#% required : no
-#%end
-#%option
-#% key: package
-#% type: string
-#% options: gstat
-#% answer: gstat
-#% description: R package to use
-#% required: no
-#%end
-#%option
-#% key: model
-#% type: string
-#% options: Nug,Exp,Sph,Gau,Exc,Mat,Ste,Cir,Lin,Bes,Pen,Per,Hol,Log,Pow,Spl,Leg,Err,Int
-#% multiple: yes
-#% label: Variogram model(s)
-#% description: Leave empty to test all models (requires automap)
-#% required: no
-#%end
-#%option
-#% key: block
-#% type: integer
-#% multiple: no
-#% label: Block size (square block)
-#% description: Block size. Used by block kriging.
-#% required: no
-#%end
-#%option
-#% key: range
-#% type: integer
-#% label: Range value
-#% description: Automatically fixed if not set
-#% required : no
-#%end
-#%option
-#% key: nugget
-#% type: integer
-#% label: Nugget value
-#% description: Automatically fixed if not set
-#% required : no
-#%end
-#%option
-#% key: sill
-#% type: integer
-#% label: Sill value
-#% description: Automatically fixed if not set
-#% required : no
-#%end
-#%option
-#% key: kappa
-#% type: double
-#% label: Kappa value
-#% description: Automatically fixed if not set
-#% required : no
-#%end
-#%option G_OPT_R_OUTPUT
-#% key: output_var
-#% label: Name for output variance raster map
-#% description: If omitted, will be <input name>_kriging.var
-#% required : no
-#%end
-from __future__ import print_function
-import os
-import sys
-
-# i18N
-import gettext
-
-if "GISBASE" not in os.environ:
-    print("You must be in GRASS GIS to run this program.")
-    sys.exit(1)
-
-gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'))
-
-# dependencies to be checked once, as they are quite time-consuming. cfr. grass.parser.
-# GRASS binding
-try:
-    import grass.script as grass
-except ImportError:
-    sys.exit(_("No GRASS-python library found"))
-
-# move other checks in functions, as R?
-
-# globals
-
-#~ Command = None
-#~ InputData = None
-#~ Variogram = None
-#~ VariogramFunction = None
-#~ robjects = None
-#~ rinterface = None
-
-# classes in alphabetical order. methods in logical order :)
-
-# <2.5 class definition, without () - please test
-
-
-class Controller:
-    """ Executes analysis. For the moment, only with gstat functions."""
-    # moved here the global variables
-
-    def __init__(self):
-        #~ self.Command = None
-        self.InputData = None
-        self.Variogram = None
-        #~ VariogramFunction = None
-        #~ robjects = None
-        #~ rinterface = None
-
-    def ImportMap(self, map, column):
-        """ Imports GRASS map as SpatialPointsDataFrame and adds x/y columns to attribute table.
-        Checks for NULL values in the provided column and exits if they are present."""
-
-        #@NOTE: new way with R - as it doesn't alter original data
-        Rpointmap = robjects.r.readVECT(map, type='point')
-        # checks if x,y columns are present in dataframe. If they do are present, but with different names,
-        # they'll be duplicated.
-        if "x" not in robjects.r.names(Rpointmap):
-            # extract coordinates with S4 method
-            coordinatesPreDF = robjects.r['as.data.frame'](robjects.r.coordinates(Rpointmap))
-            coordinatesDF = robjects.r['data.frame'](x=coordinatesPreDF.rx('coords.x1')[0],
-                                                     y=coordinatesPreDF.rx('coords.x2')[0])
-            # match coordinates with data slot of SpatialPointsDataFrame - maptools function
-            # match is done on row.names
-            Rpointmap = robjects.r.spCbind(Rpointmap, coordinatesDF)
-
-        # GRASS checks for null values in the chosen column. R can hardly handle column as a variable,
-        # looks for a hardcoded string.
-        cols = grass.vector_columns(map=map, layer=1)
-        nulls = int(grass.parse_command('v.univar',
-                                        map=map,
-                                        column=column,
-                                        type='point',
-                                        parse=(grass.parse_key_val,
-                                               {'sep': ': '}
-                                               )
-                                        )['number of NULL attributes'])
-        if nulls > 0:
-            grass.fatal(
-                _("%d NULL value(s) in the selected column - unable to perform kriging.") %
-                nulls)
-        return Rpointmap
-
-    def CreateGrid(self, inputdata):
-        Region = grass.region()
-        Grid = robjects.r.gmeta2grd()
-
-        # addition of coordinates columns into dataframe.
-        coordinatesDF = robjects.r['as.data.frame'](robjects.r.coordinates(Grid))
-        data = robjects.r['data.frame'](x=coordinatesDF.rx('s1')[0],
-                                        y=coordinatesDF.rx('s2')[0],
-                                        k=robjects.r.rep(1, Region['cols'] * Region['rows']))
-        GridPredicted = robjects.r.SpatialGridDataFrame(
-            Grid, data, proj4string=robjects.r.CRS(
-                robjects.r.proj4string(inputdata)))
-        return GridPredicted
-
-    def ComposeFormula(self, column, isblock):
-        if isblock is True:
-            predictor = 'x+y'
-        else:
-            predictor = '1'
-        print(column + "~" + predictor)
-        Formula = robjects.Formula(column + "~" + predictor)
-        return Formula
-
-    def FitVariogram(self, formula, inputdata, sill, nugget, range, kappa, model=''):
-        """ Fits variogram either automagically either specifying all parameters.
-        Returns a list containing data and model variograms. """
-
-        Variograms = {}
-
-        if model is '':
-            robjects.r.require('automap')
-            DottedParams = {}
-            #print (nugget.r_repr(), sill, range)
-            DottedParams['fix.values'] = robjects.r.c(nugget, range, sill)
-
-            if not isinstance(kappa, float):
-                # autofit gives strange results if kappa is NA
-                VariogramModel = robjects.r.autofitVariogram(formula, inputdata, **DottedParams)
-            else:
-                VariogramModel = robjects.r.autofitVariogram(
-                    formula, inputdata, kappa=kappa, **DottedParams)
-            # print robjects.r.warnings()
-            Variograms['datavariogram'] = VariogramModel.rx('exp_var')[0]
-            Variograms['variogrammodel'] = VariogramModel.rx('var_model')[0]
-            # obtain the model name. *Too* complicated to get the string instead of
-            # level, unlike R does.
-            VariogramAsDF = robjects.r['as.data.frame'](
-                VariogramModel.rx('var_model')[0])  # force conversion
-            ModelDF = VariogramAsDF.rx('model')[0]
-            Variograms['model'] = ModelDF.levels[ModelDF[1] - 1]
-        else:
-            DataVariogram = robjects.r['variogram'](formula, inputdata)
-            VariogramModel = robjects.r['fit.variogram'](DataVariogram,
-                                                         model=robjects.r.vgm(psill=sill,
-                                                                              model=model,
-                                                                              nugget=nugget,
-                                                                              range=range,
-                                                                              kappa=kappa))
-            Variograms['datavariogram'] = DataVariogram
-            Variograms['variogrammodel'] = VariogramModel
-            Variograms['model'] = model
-        return Variograms
-
-    def DoKriging(self, formula, inputdata, grid, model, block):
-        DottedParams = {'debug.level': -1}  # let krige() print percentage status
-        if block is not '':  # @FIXME(anne): but it's a string!! and krige accepts it!!
-            DottedParams['block'] = block
-        # print DottedParams
-        KrigingResult = robjects.r.krige(formula, inputdata, grid, model, **DottedParams)
-        return KrigingResult
-
-    def ExportMap(self, map, column, name, overwrite, command, variograms):
-        # add kriging parameters to raster map history
-        robjects.r.writeRAST(map, vname=name, zcol=column, overwrite=overwrite)
-        grass.run_command('r.support',
-                          map=name,
-                          title='Kriging output',
-                          history='Issued from command v.krige ' + command)
-        if command.find(
-                'model') is -1:  # if the command has no model option, add automap chosen model
-            grass.run_command('r.support',
-                              map=name,
-                              history='Model chosen by automatic fitting: ' + variograms['model'])
-
-    def Run(self, input, column, output, package, sill, nugget, range, kappa, logger,
-            overwrite, model, block, output_var, command, **kwargs):
-        """ Wrapper for all functions above. """
-
-        logger.message(_("Processing %d cells. Computing time raises "
-                         "exponentially with resolution." % grass.region()['cells']))
-        logger.message(_("Importing data..."))
-
-        if self.InputData is None:
-            self.InputData = self.ImportMap(input, column)
-        # and from here over, InputData refers to the global variable
-        #print(robjects.r.slot(InputData, 'data').names)
-        logger.message(_("Data successfully imported."))
-
-        GridPredicted = self.CreateGrid(self.InputData)
-
-        logger.message(_("Fitting variogram..."))
-
-        if block is not '':
-            self.predictor = 'x+y'
-        else:
-            self.predictor = '1'
-        if self.Variogram is None:
-            self.Variogram = self.FitVariogram(robjects.Formula(column + "~" + self.predictor),
-                                               self.InputData,
-                                               model=model,
-                                               sill=sill,
-                                               nugget=nugget,
-                                               range=range,
-                                               kappa=kappa)
-        logger.message(_("Variogram fitting complete."))
-
-        logger.message(_("Kriging..."))
-        KrigingResult = self.DoKriging(
-            robjects.Formula(
-                column + "~" + self.predictor),
-            self.InputData,
-            GridPredicted,
-            self.Variogram['variogrammodel'],
-            block)  # using global ones
-        logger.message(_("Kriging complete."))
-
-        self.ExportMap(map=KrigingResult,
-                       column='var1.pred',
-                       name=output,
-                       overwrite=overwrite,
-                       command=command,
-                       variograms=self.Variogram)
-        if output_var is not '':
-            self.ExportMap(map=KrigingResult,
-                           column='var1.var',
-                           name=output_var,
-                           overwrite=overwrite,
-                           command=command,
-                           variograms=self.Variogram)
-
-
-def main(argv=None):
-    """ Main. Calls either GUI or CLI, depending on arguments provided. """
-    #@FIXME: solve this double ifelse. the control should not be done twice.
-
-    controller = Controller()
-
-    if argv is None:
-        importR()
-        argv = sys.argv[1:]  # stripping first item, the full name of this script
-        # wxGUI call
-        if not os.getenv("GRASS_WXBUNDLED"):
-            from core import globalvar
-            globalvar.CheckForWx()
-        from modules import vkrige as GUI
-
-        import wx
-
-        app = wx.App()
-        KrigingFrame = GUI.KrigingModule(parent=None,
-                                         Rinstance=robjects,
-                                         controller=controller)
-        KrigingFrame.Centre()
-        KrigingFrame.Show()
-        app.MainLoop()
-
-    else:
-        # CLI
-        options, flags = argv
-
-        #@TODO: Work on verbosity. Sometimes it's too verbose (R), sometimes not enough.
-        if grass.find_file(options['input'], element='vector')['fullname'] is '':
-            grass.fatal(_("Vector map <%s> not found") % options['input'])
-
-        #@TODO: elaborate input string, if contains mapset or not.. thanks again to Bob for testing on 64bit.
-
-        # create output map name, if not specified
-        if options['output'] is '':
-            try:  # to strip mapset name from fullname. Ugh.
-                options['input'] = options['input'].split("@")[0]
-            except:
-                pass
-            options['output'] = options['input'] + '_kriging'
-
-        # check for output map with same name. g.parser can't handle this, afaik.
-        if grass.find_file(options['output'], element='cell')['fullname'] \
-           and os.getenv("GRASS_OVERWRITE") is None:
-            grass.fatal(_("option: <output>: Raster map already exists."))
-
-        if options['output_var'] is not '' \
-           and (grass.find_file(options['output_var'], element='cell')['fullname']
-                and os.getenv("GRASS_OVERWRITE") is None):
-            grass.fatal(_("option: <output>: Variance raster map already exists."))
-
-        importR()
-        if options['model'] is '':
-            try:
-                robjects.r.require("automap")
-            except ImportError as e:
-                grass.fatal(_("R package automap is missing, no variogram autofit available."))
-        else:
-            if options['sill'] is '' or options['nugget'] is '' or options['range'] is '':
-                grass.fatal(
-                    _("You have specified model, but forgot at least one of sill, nugget and range."))
-
-        #@TODO: let GRASS remount its commandstring. Until then, keep that 4 lines below.
-        # print grass.write_command(argv)
-        command = ""
-        notnulloptions = {}
-        for k, v in options.items():
-            if v is not '':
-                notnulloptions[k] = v
-        command = command.join("%s=%s " % (k, v) for k, v in notnulloptions.items())
-
-        # re-cast integers from strings, as parser() cast everything to string.
-        for each in ("sill", "nugget", "range", "kappa"):
-            if options[each] is not '':
-                if each == "kappa":
-                    options[each] = float(options[each])
-                else:
-                    options[each] = int(options[each])
-            else:
-                options[each] = robjects.r('''NA''')
-
-        #controller = Controller()
-        controller.Run(input=options['input'],
-                       column=options['column'],
-                       output=options['output'],
-                       overwrite=os.getenv("GRASS_OVERWRITE") == 1,
-                       package=options['package'],
-                       model=options['model'],
-                       block=options['block'],
-                       sill=options['sill'],
-                       nugget=options['nugget'],
-                       range=options['range'],
-                       kappa=options['kappa'],
-                       output_var=options['output_var'],
-                       command=command,
-                       logger=grass)
-
-
-def importR():
-    # R
-    # unuseful since rpy2 will complain adequately.
-    # try:
-    #    #@FIXME: in Windows, it launches R terminal
-    #    grass.find_program('R')
-    # except:
-    #    sys.exit(_("R is not installed. Install it and re-run, or modify environment variables."))
-
-    # rpy2
-    global robjects
-    global rinterface
-    grass.message(_('Loading dependencies, please wait...'))
-    try:
-        import rpy2.robjects as robjects
-        import rpy2.rinterface as rinterface  # to speed up kriging? for plots.
-    except ImportError:
-        # ok for other OSes?
-        grass.fatal(_("Python module 'Rpy2' not found. Please install it and re-run v.krige."))
-
-    # R packages check. Will create one error message after check of all packages.
-    missingPackagesList = []
-    for each in ["rgeos", "gstat", "rgrass7", "maptools"]:
-        if not robjects.r.require(each, quietly=True)[0]:
-            missingPackagesList.append(each)
-    if missingPackagesList:
-        errorString = _("R package(s) ") + \
-            ", ".join(map(str, missingPackagesList)) + \
-            _(" missing. Install it/them and re-run v.krige.")
-        grass.fatal(errorString)
-
-if __name__ == '__main__':
-    if len(sys.argv) > 1:
-        sys.exit(main(argv=grass.parser()))
-    else:
-        main()