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 
Switch to threaded view of this topic Create a new topic Submit Reply
value_locate.pro location in IDL library [message #50105] Wed, 13 September 2006 14:16 Go to next message
IDL_Newbie_2000 is currently offline  IDL_Newbie_2000
Messages: 5
Registered: June 2006
Junior Member
I am trying to use GDL to do some of my work and noticed it was
reporting a missing function of value_locate(). I looked for this
procedure/function in IDL library but can't find it, which is really
strange to me, since a lot of functions seem to use it in IDL (e.g.
mean()). Would any one tell me where I can find this function in the
computer?

Thanks in advace.
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 next 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
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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 09:15:41 PDT 2025

Total time taken to generate the page: 0.00603 seconds