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

Home » Public Forums » archive » Re: Need help with value_locate and interpolation
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: Need help with value_locate and interpolation [message #38950 is a reply to message #38949] Fri, 02 April 2004 09:06 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 02 Apr 2004 12:00:54 -0500, Ben Tupper wrote:

> Leslie Welser wrote:
>
>> I'm having some trouble with using the value_locate function. Let's
>> say I have a vector with 10 elements, and I want to find the
>> "interpolated" array index for a particular value. I know how to
>> interpolate the vector, but I can't find a way to return the index as
>> a float and not an integer. In other words, given a certain value of
>> the array, I would like to find a way to return the information that
>> that interpolated value is at an index of, say, 4.27. Is there a
>> simple way to do this?
>> Thanks,
>> Leslie
>
> Hello,
>
> I can't understand what you are after, at least, I don't see how an
> interpolated value could have an "index" into the original. Could you
> take another swing at your question - maybe with pseudo-code of what you
> want to do.

I think he probably means his data is monotonic, in which case
something like:

frac=interpol(findgen(n_elements(data)),data,value)

will work. Here `value' can be a vector (and should be, if you have
multiple values to search).

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: submit idl job with AT command?
Next Topic: Re: selfcreating filenames for putput files?

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

Current Time: Wed Oct 08 15:56:52 PDT 2025

Total time taken to generate the page: 0.00410 seconds