title: Why is scipy.interpolate.griddata so slow?
body: <p>I'm trying to use <code>scipy.interpolate.griddata</code> to interpolate between ~400,000 data points that are <strong>not</strong> on a regular grid. However I can't seem to ever get it to finish running! I'm trying to interpolate the values of the function at points on a grid that is 200x200 (~40,000) data points. Here are the function calls I'm issuing:
  </p>
  
  <pre><code>from scipy.interpolate import griddata
  import numpy as np
  
  #Load in all the data
  [raw_x_val,raw_y_val,raw_z_val] = load_data('filename')
  
  #Generate interpolating mesh
  [x_interp,y_interp] = np.meshgrid(np.linspace(min_interp_val,max_interp_val,200),np.linspace(min_interp_val,max_interp_val,200))
  z_interp = griddata((raw_x_val,raw_y_val),raw_z_val,(x_interp,y_interp),method='linear')
  </code></pre>
  
  <p>I've looked at the data output from <code>load_data</code>, and it seems like everything loads fine. The dimensions of <code>raw_x_val</code>,<code>raw_y_val</code> and <code>raw_z_val</code> are <code>(410500,)</code>. I let it run for about half an hour and it never really finishes!
  Alternatively, I tried to run a very similar set of function calls in <code>MATLAB</code> and I was able to get everything loaded and interpolated in about 2 seconds!</p>
  
  <p>Am I doing something wrong in python, or is it just that the <code>scipy.interpolate.griddata</code> function is not meant to handle this kind of data. Alternately would any of have suggestions about what functions/libraries I could use to do this. I'd ideally not want to do this inside of <code>MATLAB</code></p>