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 #64743] Thu, 15 January 2009 01:17 Go to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
Hu wrote:
> 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.

how about this:

IDL> x = [1,2,0,0,5,6,0,8,9, 0,9,8,0,0,0,0,3,2,0]
IDL> xi = where( x gt 0)
IDL> xv = x[xi]
IDL> print, xi, xv
0 1 4 5 7 8 10
11 16 17
1 2 5 6 8 9 9
8 3 2

good data is in xi, xv

IDL> yi = where( x eq 0)
IDL> yv = interpol( xv, xi, yi)
% Compiled module: INTERPOL.
IDL> print, yv
3 4 7 9 7 6 5
4 1

merge data in xv with yv:

IDL> y = x
IDL> y[yi] = yv
IDL> print, y
1 2 3 4 5 6 7
8 9 9 9 8 7
6 5 4 3 2 1
IDL>


note: this does not "complete the hill" in 8 9 0 9 8 to 8 9 10 9 8, but linearly
interpolates to 8 9 9 9 8.


chl
[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 15:53:15 PDT 2025

Total time taken to generate the page: 0.00418 seconds