title: Does anyone know how to perform a bicubic spline interpolation in Python?
body: <p>The bicubic spline interpolation is an extension of cubic spline for interpolating on a 2D regular grid. The interpolated surface is smoother than corresponding surfaces obtained by bilinear interpolation.</p>
  
  <p>Does anyone have already the corresponding function that enables such an interpolation?</p>
  
  <p>Here is the beginning of the code:</p>
  
  <pre><code>def bicubicspline_interpolation(x, y, points):
  '''Interpolate (x,y) from values associated with four points.
  
  The four points are a list of four triplets:  (x, y, value).
  The four points can be in any order.  They should form a rectangle.
  
      &gt;&gt;&gt; bilinear_interpolation(12, 5.5,
      ...                        [(10, 4, 100),
      ...                         (20, 4, 200),
      ...                         (10, 6, 150),
      ...                         (20, 6, 300)])
      165.0
  
  '''
  # See formula at:  http://en.wikipedia.org/wiki/Bicubic_interpolationon
  
  points = sorted(points)               # order points by x, then by y
  (x1, y1, q11), (_x1, y2, q12), (x2, _y1, q21), (_x2, _y2, q22) = points
  
  if x1 != _x1 or x2 != _x2 or y1 != _y1 or y2 != _y2:
      raise ValueError('points do not form a rectangle')
  if not x1 &lt;= x &lt;= x2 or not y1 &lt;= y &lt;= y2:
      raise ValueError('(x, y) not within the rectangle')
  
  
  
  value = 
  
  return value
  </code></pre>
  
  <p>Any help please?</p>
  
  <p>Thank you!</p>
  
  <p>a</p>