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

Home » Public Forums » archive » Re: question about array 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: question about array interpolation [message #64753 is a reply to message #64744] Wed, 14 January 2009 13:52 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jan 14, 1:54 pm, Hu <jha...@gmail.com> wrote:
> On Jan 14, 3:44 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
>
>
>
>> On Jan 14, 1:40 pm, David Fanning <n...@dfanning.com> wrote:
>
>>> Hu writes:
>>>> Oh, that's depressing.
>>>> I mean, it looks like a simple question, but really not.
>>>> anyway, thanks you, David.
>
>>> I'm clearly missing something. What looks simple to you?
>>> How would you describe what you want to do in words?
>
>>> x = [1,2,0,0,5,6,0,8,9, 0,9,8,0,0,0,0,3,2,0]
>>> y = [1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2,1]
>
>>> I just don't see any relationship between those
>>> two arrays at all. I've got to start eating more
>>> of the fish oil tablets or something.
>
>> I think the zeros are meant to be undefined values that should be
>> replaced by an interpolated value.
>
>> Mike
>> --www.michaelgalloy.com
>> Tech-X Corporation
>> Associate Research Scientist
>
> Yes, mike got it,we can replace 'zero's as other unmeaningful symbols,
> I just want to replace these unmeaningful symbols with interpolated
> values from the known values.
>
> sorry for any misunderstanding in my questions.

OK, how about:

ind = where(x ne 0, count, complement=c)
result = interpol(x[ind], ind, c)

y = x
y[c] = result
print, y

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Duplicate lat/long points
Next Topic: Solve memory problems

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

Current Time: Wed Oct 08 18:03:39 PDT 2025

Total time taken to generate the page: 0.00246 seconds