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

Home » Public Forums » archive » value_locate.pro location in IDL library
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: value_locate.pro location in IDL library [message #50169 is a reply to message #50105] Fri, 15 September 2006 07:26 Go to previous messageGo to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Mark Hadfield wrote:
> ZMY wrote:
>> Thanks, Wayne and David. The information is very helpful. Craig's
>> value_locate.pro still doesn't work since spl_interp is not built into
>> GDL yet (as far as I can tell for version 0.9).
>
> Surely you could patch in an alternative interpolation routine. Linear
> interpolation would be adequate in many cases.
>
Hi,

This is from the online help...

"This function is useful for interpolation and table-lookup, and is an
adaptation of the locate() routine in Numerical Recipes. VALUE_LOCATE
uses the bisection method to locate the interval."

You can find the Numerical Recipes algorithm online. Seems like it
should should easy to implement in IDL. One interesting thing I have
recently bumped into is that IDL's built-in works with strings.

IDL> Arr = ['at','bat','cat','dat','eat','fat','gat','hat']
IDL> print, value_locate(arr, 'cup')
2
IDL> print, value_locate(arr, 'eet')
4
IDL> print, value_locate(arr, 'Bat')
-1
IDL> print, value_locate(reverse(arr), 'cup')
4

Nifty!
Ben
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Newsgroup Decorum
Next Topic: IDL has problem with X windows on OS X 10.4

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

Current Time: Thu Oct 09 20:56:47 PDT 2025

Total time taken to generate the page: 0.16179 seconds