comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » interpolate weirdness
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: interpolate weirdness [message #87863 is a reply to message #87662] Fri, 28 February 2014 08:31 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Dear Helder,
thank you for clarification. The situation has changed. Desired values are now far away from boundaries and I can use something like this:

function cr_interpol,dat,mat_old,mat_new,cubic=cubic

ndim = size(dat,/ndimensions)
dims = size(dat,/dimensions)
case (1b) of
ndim eq 1 : begin
newx = (interpol(ulindgen(dims[0]),(mat_old[0,*])[*],(mat_new[0,*]) [*]))[*]
result = interpolate(dat[*],newx,/grid,cubic=cubic)
end
ndim eq 2 : begin
newx = (interpol(ulindgen(dims[0]),(mat_old[0,*])[*],(mat_new[0,*]) [*]))[*]
newy = (interpol(ulindgen(dims[1]),(mat_old[1,*])[*],(mat_new[1,*]) [*]))[*]
result = interpolate(dat,newx,newy,/grid,cubic=cubic)
end
ndim eq 3 : begin
newx = (interpol(ulindgen(dims[0]),(mat_old[0,*])[*],(mat_new[0,*]) [*]))[*]
newy = (interpol(ulindgen(dims[1]),(mat_old[1,*])[*],(mat_new[1,*]) [*]))[*]
newz = (interpol(ulindgen(dims[2]),(mat_old[2,*])[*],(mat_new[2,*]) [*]))[*]
result = interpolate(dat,newx,newy,newz,/grid,cubic=cubic)
end
endcase
return,result
end



Cheers

Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Behaviour of colorbar title in z-buffer?
Next Topic: Orientation of Contour Labels

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 17 21:30:53 PDT 2025

Total time taken to generate the page: 1.35705 seconds