class_docstr: Interpolate a function defined on the nodes of a triangulation by
  the natural neighbors method.
  
  NNInterpolator(triangulation, z, default_value=numpy.nan)
  
  triangulation -- Triangulation instance
  z -- the function values at each node of the triangulation
  default_value -- a float giving the default value should the interpolating
    point happen to fall outside of the convex hull of the triangulation
  
  At the moment, the only regular rectangular grids are supported for
  interpolation.
  
      vals = interp[ystart:ystop:ysteps*1j, xstart:xstop:xsteps*1j]
  
  vals would then be a (ysteps, xsteps) array containing the interpolated
  values. These arguments are interpreted the same way as numpy.mgrid.
  
  Natural Neighbors Interpolation
  -------------------------------
  One feature of the Delaunay triangulation is that for each triangle, its
  circumcircle contains no other point (although in degenerate cases, like
  squares, other points may be *on* the circumcircle). One can also construct
  what is called the Voronoi diagram from a Delaunay triangulation by
  connecting the circumcenters of the triangles to those of their neighbors to
  form a tesselation of irregular polygons covering the plane and containing
  only one node from the triangulation. Each point in one node's Voronoi
  polygon is closer to that node than any other node.
  
  To compute the Natural Neighbors interpolant, we consider adding the
  interpolation point to the triangulation. We define the natural neighbors of
  this point as the set of nodes participating in Delaunay triangles whose
  circumcircles contain the point. To restore the Delaunay-ness of the
  triangulation, one would only have to alter those triangles and Voronoi
  polygons. The new Voronooi diagram would have a polygon around the inserted
  point. This polygon would "steal" area from the original Voronoi polygons.
  For each node i in the natural neighbors set, we compute the area stolen
  from its original Voronoi polygon, stolen[i]. We define the natural
  neighbors coordinates
  
      phi[i] = stolen[i] / sum(stolen,axis=0)
  
  We then use these phi[i] to weight the corresponding function values from
  the input data z to compute the interpolated value.
  
  The interpolated surface is C1-continuous except at the nodes themselves
  across the convex hull of the input points. One can find the set of points
  that a given node will affect by computing the union of the areas covered by
  the circumcircles of each Delaunay triangle that node participates in.
class_docstr_tok: ["Interpolate","a","function","defined","on","the","nodes","of","a","triangulation","by","the","natural","neighbors","method",".","NNInterpolator","(","triangulation",",","z",",","default_value=numpy.nan",")","triangulation","--","Triangulation","instance","z","--","the","function","values","at","each","node","of","the","triangulation","default_value","--","a","float","giving","the","default","value","should","the","interpolating","point","happen","to","fall","outside","of","the","convex","hull","of","the","triangulation","At","the","moment",",","the","only","regular","rectangular","grids","are","supported","for","interpolation",".","vals","=","interp","[","ystart",":","ystop",":","ysteps","*","1j",",","xstart",":","xstop",":","xsteps","*","1j","]","vals","would","then","be","a","(","ysteps",",","xsteps",")","array","containing","the","interpolated","values",".","These","arguments","are","interpreted","the","same","way","as","numpy.mgrid",".","Natural","Neighbors","Interpolation","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","One","feature","of","the","Delaunay","triangulation","is","that","for","each","triangle",",","its","circumcircle","contains","no","other","point","(","although","in","degenerate","cases",",","like","squares",",","other","points","may","be","*","on","*","the","circumcircle",")",".","One","can","also","construct","what","is","called","the","Voronoi","diagram","from","a","Delaunay","triangulation","by","connecting","the","circumcenters","of","the","triangles","to","those","of","their","neighbors","to","form","a","tesselation","of","irregular","polygons","covering","the","plane","and","containing","only","one","node","from","the","triangulation",".","Each","point","in","one","node","'s","Voronoi","polygon","is","closer","to","that","node","than","any","other","node",".","To","compute","the","Natural","Neighbors","interpolant",",","we","consider","adding","the","interpolation","point","to","the","triangulation",".","We","define","the","natural","neighbors","of","this","point","as","the","set","of","nodes","participating","in","Delaunay","triangles","whose","circumcircles","contain","the","point",".","To","restore","the","Delaunay-ness","of","the","triangulation",",","one","would","only","have","to","alter","those","triangles","and","Voronoi","polygons",".","The","new","Voronooi","diagram","would","have","a","polygon","around","the","inserted","point",".","This","polygon","would","``","steal","''","area","from","the","original","Voronoi","polygons",".","For","each","node","i","in","the","natural","neighbors","set",",","we","compute","the","area","stolen","from","its","original","Voronoi","polygon",",","stolen","[","i","]",".","We","define","the","natural","neighbors","coordinates","phi","[","i","]","=","stolen","[","i","]","\/","sum","(","stolen",",","axis=0",")","We","then","use","these","phi","[","i","]","to","weight","the","corresponding","function","values","from","the","input","data","z","to","compute","the","interpolated","value",".","The","interpolated","surface","is","C1-continuous","except","at","the","nodes","themselves","across","the","convex","hull","of","the","input","points",".","One","can","find","the","set","of","points","that","a","given","node","will","affect","by","computing","the","union","of","the","areas","covered","by","the","circumcircles","of","each","Delaunay","triangle","that","node","participates","in","."]
code: def __call__(self, intx, inty):
      intz = nn_interpolate_unstructured(
          intx,
          inty,
          self.default_value,
          self.triangulation.x,
          self.triangulation.y,
          self.z,
          self.triangulation.circumcenters,
          self.triangulation.triangle_nodes,
          self.triangulation.triangle_neighbors,
      )
      return intz
  
file_path: nupic-legacy/external/linux32arm/lib/python2.7/site-packages/matplotlib/delaunay/interpolate.py
imports: import numpy
  from matplotlib._delaunay import compute_planes, linear_interpolate_grid, nn_interpolate_grid
  from matplotlib._delaunay import nn_interpolate_unstructured
label_desc: Use image node_id 3 for calling the NNInterpolator obj's underlying member method code with example usage: obj.__call__(intx, inty) and returns: intz