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

Home » Public Forums » archive » EXPAND.PRO - - - again!
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: Expand [message #10620 is a reply to message #733] Mon, 05 January 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kelly Dean (krdean@lamar.colostate.edu) writes:

> I am reading some AVHRR LAC data in the Level 1B format. The image
> provides 51 latitude/longitude pairs for each 2048 pixel scan line. They
> are sampled every 40 points starting at point 25 (25, 65, 105,..., 1945,
> 1985, 2025).
>
> I created a simple IDL routine to expand the 51 values to 2048 values
> using FOR loops. I am looking for suggestions to make this more
> efficient.

Uh, why? It's pretty darn fast on my middling machine. :-)

[Code snipped.]

I don't think you can get rid of the outside loop (stepping
between the known points), but you can speed up the inside
loop I guess (interpolating values between the known points)
by doing something like this:

FOR j=25, 1985, 40 DO BEGIN
array2048(j:j+39) = Findgen(40) * $
((value[j+39]-value[j])/39) + value[j]
ENDFOR

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: nonlinregress
Next Topic: Re: Congressional district boundaries

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

Current Time: Mon Dec 01 09:53:41 PST 2025

Total time taken to generate the page: 1.20400 seconds