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

Home » Public Forums » archive » Re: Is it possible to speed up the Interpolate command?
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: Is it possible to speed up the Interpolate command? [message #89255 is a reply to message #89244] Fri, 08 August 2014 16:19 Go to previous messageGo to previous message
Stephen Messenger is currently offline  Stephen Messenger
Messages: 3
Registered: August 2014
Junior Member
On Thursday, August 7, 2014 10:52:37 PM UTC-4, wlandsman wrote:
> On Thursday, August 7, 2014 6:11:29 PM UTC-4, Stephen Messenger wrote:
>
>> I've been stuck on figuring out how to speed up an interpolation calculation and wondered if anyone has any suggestions?
>
>
>
>> for i=0, numlines-1 do begin
>
>> Values(*,i)=interpolate(datacube(*,*,i),x_loc,y_loc)
>
>> endfor
>
>
>
> One suggestion is to replace the above with
>
>
>
> for i=0,numlines-1 do begin
>
> values[0,i] = interpolate(data cube[*,*,i],x_loc,y_loc)
>
> endfor
>
>
>
> https://www.idlcoyote.com/code_tips/asterisk.html
>
>
>
> You might also find a slight speed improvement with by writing
>
>
>
> for i=0,numlines-1 do $
>
> values[0,i] = interpolate(data cube[*,*,i],x_loc,y_loc)
>
>
>
> though the improvement will be less than it was in old versions of IDL.

Hi all,

Thank you for the suggestions.

Mike: I'm going to check if that will work for me. Thank you for that suggestion.

Craig: I followed the code you wrote below and the math and reasoning makes sense. However, it actually takes almost 5 times longer to run. I'm thinking that this may have to do with the "values" line that requires accessing entries within the large data cube. I'm hammering away at figuring out how to modify the suggested method to calculate faster, but wanted to check if there were any suggestions? Thank you for your help!

wlandsman: I hadn't seen that trick yet. Thank you for the suggestion! I didn't detect a bump in speed, but I'm using 8.1, so maybe they fixed it since the earlier versions.

I haven't been able to find the source code for INTERPOLATE within the IDL lib files. If you happen to know how to dig that source code out of IDL, I would definitely appreciate the expertise.

Thanks!

Stephen
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL kernel for IPython/Jupyter Notebooks
Next Topic: help with appending strings

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

Current Time: Fri Oct 10 09:33:57 PDT 2025

Total time taken to generate the page: 0.31697 seconds