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  |
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  |
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
|
|
|