>  Docs Center  >  Libraries  >  Coyote  >  CGKRIG2D


  The cgKrig2D function interpolates a regularly or irregularly sampled set of points of
  the form z = f(x, y) to produced a gridded 2D array using a statistical process known
  as kriging. Kriging is a method of optimal interpolation based on regression against known
  or observed z values of surrounding data points, weighted according to spatial covariance
  values by various types of kriging model functions. Each grid location is estimated from
  observed values at surrounding locations. It is often used with spatial data.
  Like all interpolation schemes, kriging can produces spurious results in extreme cases,
  but has the advantage of being able to compensate for the effects of data clustering and
  other, similar problems better than other interpolation methods such as inverse distance squared,
  splines, and triangulation methods. This particular version of Krig2D is orders of magnitude
  faster than the version of Krig2D that was distributed with IDL through IDL 8.2.3.
  An excellent explanation of the kriging process can be found here::
  An explanation of the innovation that caused Krig2D to be made faster by several orders
  of magnitude can be found here::
  I've implemented the kriging mathematical models described in the following references::


    Math, Interpolation, Gridding


    To create a dataset of N random points and determine the surface formed from such points::
      n = 500 ;# of scattered points
      seed = -121147L ;For consistency
      x = RANDOMU(seed, n)
      y = RANDOMU(seed, n)
      ; Create a dependent variable in the form a function of (x,y)
      data = 3 * EXP(-((9*x-2)^2 + (7-9*y)^2)/4) + $
        3 * EXP(-((9*x+1)^2)/49 - (1-0.9*y)) + $
        2 * EXP(-((9*x-7)^2 + (6-9*y)^2)/4) - $
        EXP(-(9*x-4)^2 - (2-9*y)^2)
      params = [0.5, 0.0]
      interpArray = cgKrig2D(data, x, y, EXPONENTIAL=params, XOUT=xout, YOUT=yout)
      cgSurf, interpArray, xout, yout, /Save
      cgPlots, x, y, data, PSYM=2, Color='red', /T3D


      David W. Fanning
      1645 Sheely Drive
      Fort Collins, CO 80526 USA
      Phone: 970-221-0438
      E-mail: david@idlcoyote.com
      Coyote's Guide to IDL Programming: http://www.idlcoyote.com


    Written, 15 Oct 2013, based on a fast varient of the Krig2D program in the IDL library.


    Copyright (c) 2013, Fanning Software Consulting, Inc.

© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us