On Friday 10 January 2014 18:55:37 Patrick Alken wrote: > On 01/10/2014 05:27 PM, jeremy theler wrote: > > Hi all, > > > > I consider the addition of these routines to GSL as a major breakthrough. > > > > Now I have three questions about generalization: > > 1. can these 2D interpolation routines be extended to scattered (i.e. > > non- > > > > rectangular) data? > > Not currently, but this can always be done with least-squares models. > I'm not aware of any available software that interpolates on nonuniform > grids - do you know of any?
I think I saw a python numerical library (whose name I forgot) that performed some kind of scattered-data interpolation. I think it used a weigthed average of first n neighbors. What I do in these cases is a nearest-neighbors search using a k-dimensional tree to sort the data. Some simple 2D examples can be seen in http://www.talador.com.ar/jeremy/wasora/realbook/._realbook010.html For two dimensional functions such as f(x,y) I once tried to do a 3-nearest neighbors search, fit a plane as z = a*x + b*y + c an then evaluate the plane z at the desired (x,y) location, but that approach had more problems than advantages. Actually, wasora is a piece of software I am writing that acts as a high-level interface to GSL for most of its features (except multidim interpolation for now, and ODE/DAE systems for which it uses SUNDIALS). Some examples of the GSL manual are rewritten as wasora inputs in http://www.talador.com.ar/jeremy/wasora/realbook/._realbook015.html If someone wants to try, comments are welcome. > > 2. can these 2D interpolation routines be extended to n dimensions? > > Once the 2D code is imported I'd like to make at least a 3D linear > interpolater, which should be straightforward. Good. Are n dimensions straightforward also? -- jeremy
