[Scipy-tickets] [SciPy] #1727: LinearNDInterpolator hangs on 4D data set

SciPy Trac scipy-tickets@scipy....
Sun Sep 30 11:20:54 CDT 2012


#1727: LinearNDInterpolator hangs on 4D data set
--------------------------------+-------------------------------------------
  Reporter:  miked983           |       Owner:  pv                               
      Type:  defect             |      Status:  closed                           
  Priority:  high               |   Milestone:  Unscheduled                      
 Component:  scipy.interpolate  |     Version:  0.10.0                           
Resolution:  invalid            |    Keywords:  LinearNDInterpolator, interpolate
--------------------------------+-------------------------------------------

Comment(by pv):

 For reference, `interpn` implementation looks something like this:
 {{{
 import numpy as np
 from scipy.interpolate import interp1d

 def interpn(*args, **kw):
     """Interpolation on N-D.

     ai = interpn(x, y, z, ..., a, xi, yi, zi, ...)
     where the arrays x, y, z, ... define a rectangular grid
     and a.shape == (len(x), len(y), len(z), ...)
     """
     method = kw.pop('method', 'cubic')
     if kw:
         raise ValueError("Unknown arguments: " % kw.keys())
     nd = (len(args)-1)//2
     if len(args) != 2*nd+1:
         raise ValueError("Wrong number of arguments")
     q = args[:nd]
     qi = args[nd+1:]
     a = args[nd]
     for j in range(nd):
         a = interp1d(q[j], a, axis=j, kind=method)(qi[j])
     return a
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1727#comment:4>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list