From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19254 invoked by alias); 14 Jan 2014 01:51:00 -0000 Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org Received: (qmail 19114 invoked by uid 89); 14 Jan 2014 01:50:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_50,RCVD_IN_BRBL_LASTEXT,RCVD_IN_SORBS_WEB,SPF_NEUTRAL,TVD_RCVD_IP autolearn=no version=3.3.2 X-HELO: server8.dns-grupohost.com Received: from 66-7-198-42.static.ahosting.biz (HELO server8.dns-grupohost.com) (66.7.198.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 14 Jan 2014 01:50:58 +0000 Received: from [201.254.111.215] (port=18671 helo=tom.localnet) by server8.dns-grupohost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1W2t9e-001VIw-Rl for gsl-discuss@sourceware.org; Mon, 13 Jan 2014 20:50:59 -0500 From: jeremy theler To: gsl-discuss@sourceware.org Subject: Re: interp2d discussion Date: Tue, 14 Jan 2014 01:51:00 -0000 Message-ID: <1734301.PepIFFiX6L@tom> User-Agent: KMail/4.11.3 (Linux/3.2.0-4-amd64; KDE/4.11.3; x86_64; ; ) In-Reply-To: <52D0A499.20000@colorado.edu> References: <520EB115.9070606@ellipsix.net> <1475379.W4E7QPn8Ol@tom> <52D0A499.20000@colorado.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Get-Message-Sender-Via: server8.dns-grupohost.com: authenticated_id: jeremy@talador.com.ar X-SW-Source: 2014-q1/txt/msg00013.txt.bz2 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