Regrid / Interpolation Question [message #79686] |
Thu, 22 March 2012 16:18 |
Sean[1]
Messages: 11 Registered: July 2005
|
Junior Member |
|
|
All,
I have what seems to be a straightforward re-gridding/interpolation problem, but AFAIK there is no built-in vectorized way to do this that avoids loops.
Here's my inputs --
vin and yin are arrays of size (ni, nj), and the values of yin are ordered along rows
(e.g., yin[i+1,*] > yin[i,*] for 0 =< i =< (ni-2) )
yout is an array of length nk
The looped version of the interpolation is the following:
yout = fltarr(nk,nj)
for j = 0, nj-1 do yout[*,j] = interpol( yin[*,j], vin[*,j], yout)
Is there an elegant and/or built-in way to do this without involving a loop?
I've written a somewhat convoluted program to do this without a loop, but it involves some transforming and doesn't seem very elegant. I'm happy to upload if someone wants to see it.
Sean
|
|
|