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

Home » Public Forums » archive » Re: Congrid and interpolate problem!
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
Re: Congrid and interpolate problem! [message #65397] Mon, 02 March 2009 04:53
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
d.poreh@gmail.com wrote:
> I want to interpolate y to remove the 5�s to take
> continues value for each location (x).

You do not tell us exactly what you do, and what happens, and
what different thing you wanted to happen, but if you just
interpolate the y array, surely you get most of your original 5s
back? You would have to throw away the 5s first and then use
x=[1,2,3,1000], y=[1,2,3,200] for your interpolation input.
Of course, there are simpler ways of getting an array with
linearly increasing values from 3 to 200.


chl
Re: Congrid and interpolate problem! [message #65404 is a reply to message #65397] Sun, 01 March 2009 07:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
d.poreh@gmail.com writes:

> I have got a problem and couldn't solve it. Let I have an array:
> arr=3Dx,y and x is location indicator and y is my function. My data is
> something like this:
> x=1,2,3,4,..,999,1000
> y=1,2,3,5,5,5,...5,200
> And size(x)=size(y). I want to interpolate y to remove the 5s to take
> continues value for each location (x). I used congrid and interpolate
> function but still doesn't work. Any help?

I would do it like this:

s = N_Elements(y)
min = Min(y, MAX=max)
y = Scale_Vector(Indgen(s), min, max)

You can find Scale_Vector here:

http://www.dfanning.com/programs/scale_vector.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 1e38 limit?
Next Topic: Help on ENVI

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

Current Time: Thu Oct 09 21:21:43 PDT 2025

Total time taken to generate the page: 0.00682 seconds