Re: Vectorize procedure [message #68971] |
Thu, 10 December 2009 10:03  |
Romolo Politi
Messages: 6 Registered: December 2007
|
Junior Member |
|
|
On 10 Dic, 16:25, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 041dea05-b2af-435a-b9e9-7ca360287...@p35g2000yqh.googlegroup s.com >,
> Romolo Politi <romolo.pol...@gmail.com> wrote:
>
>> Hi,
>> I'm vectorizing a procedure in order to delete three for loops and
>> increase the speed.
>> I have to calculating the interpolation on a regular grid.
>> newy=interpol(y,x,newx,/spline)
>> in the loop manner for each index of the loop there are three
>> different arrays .
>> in the vectorize manner I have three 3D matrices, But I do not found a
>> way to calculate the interpolation matrix.
>> Any one have suggestions?
>
>> Thanks
>
>> Romolo
>
> I'm afraid that you have not clearly explained your problem. Are you
> trying to do 3-D cubic spline interpolation? As far as I know,
> standard IDL does not contain a multi-dimensional spline interpolation
> procedure, only the 1-D functionality available in INTERPOL, SPLINE, and
> SPL_INTERP. You can do vectorized multi-dimensional *linear* interpolation
> by using INTERPOLATE.
>
> The Advanced Math and Statistics package (extra cost) includes the IMSL
> spline interpolation functions. You can view the help files and
> see if that is what you need.
>
> http://127.0.0.1:60523/help/index.jsp
>
> Ken Bowman
Sorry for the not clarity.
my situation is
x=fltarr(3200,201,201)
y=fltarr(3200,201,201)
newx=fltarr(799,201,201)
newy=fltarr(799,201,201)
for i=0,200 do begin
for j=0,200 do begin
newy[*,i,j]=interpol(y[*,i,j],x[*,i,j],newx[*,i,j],/SPLine)
endfor
endfor
I like vectorize this loop.
Thanks, and sorry again
Romolo Politi
|
|
|