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 #50230 is a reply to message #50169] Sat, 16 September 2006 06:05 Go to previous message
Joel Gales is currently offline  Joel Gales
Messages: 6
Registered: December 2001
Junior Member
Ben Tupper wrote:
> 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

There is a VALUE_LOCATE procedure in the CVS repository in src/pro.

Joel
[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: Fri Oct 10 02:32:32 PDT 2025

Total time taken to generate the page: 0.00620 seconds