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

Home » Public Forums » archive » how to extend a vector from size A to size B, (A<B) without "damage" the data in A
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
how to extend a vector from size A to size B, (A<B) without "damage" the data in A [message #79517] Wed, 07 March 2012 13:51 Go to next message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
Hi all!

I have the fowling problem:
I have a array vector A with size [970] elements lets say, and another that is 'B' with [1024] elements. now... both contain spectra and I want to do cross-correlation between the two vectors. This will be possible if A is 1024 element vector.

I am new in IDL and shoot and try several thing here like:
A = interpol(A,1024)
and I saw also someone suggested:
A = [A, intarr(n_elements(B)-n_elements(A))] , but doesn't give me what I want.

A is synthetic spectra (mask) and I just want to increase the resolution without losing the quality of the data(the relative distances between the lines)

A = interpol(A,1024), actually works, but I see very obvious differences in the 970 and the result spectra.

Anybody know how to do it?

All the best,
Tito
Re: how to extend a vector from size A to size B, (A<B) without "damage" the data in A [message #79629 is a reply to message #79517] Fri, 16 March 2012 14:58 Go to previous message
santorofer is currently offline  santorofer
Messages: 14
Registered: July 2008
Junior Member
Hi Tito,

Could the following be what you are looking for?:

REBIN()

For example

; A four point vector:
A = [0, 10, 20, 30]

; Expand by a factor of 3:
B = REBIN(A, 12)

PRINT, B

IDL prints:

0 3 6 10 13 16 20 23 26 30 30 30

See the IDL help on this function.
Also, CONGRID() could also help, and is a bit more general than REBIN().

Cheers,
Fernando
Exelis VIS
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: cgHistoPlot - locations and histdata keywords?
Next Topic: Re: Array Tiling - The IDL Way

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

Current Time: Wed Oct 08 13:52:35 PDT 2025

Total time taken to generate the page: 0.00510 seconds