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

Home » Public Forums » archive » Re: 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 
Return to the default flat view Create a new topic Submit Reply
Re: how to extend a vector from size A to size B, (A<B) without "damage" the data in A [message #79505 is a reply to message #79503] Thu, 08 March 2012 15:42 Go to previous messageGo to previous message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
Dear David,
Dear Craig,

First of all I want to thank you both for your answers!

David, the "congrid" function did exactly what I wanted! Thank you very much for the tip!

However, another problem just rise and this lead to my answer to Craig....

First let me explain my set up and then I will discus my constrains about the "congrid" function.

I have "A" vector which I use for synthetic mask spectrum, witch I will cross-correlate with my science spectra in order to determine the RV signal.
This "A" vector is actually extracted from the HITRAN catalog (atmosphere absorption line database) for the C02 molecule in the IR. Actually this is teluric lines witch in other hand also present on my science spectra.

So I just extracted all the C02 line in range from 6222 to 6248 cm^-1 for example. I convert them to wavelengths and it turn out that in this range I have around 970 C02 lines, BUT only 20 of them are the sharp and deep lines that I need (the telluric). So this "A" 970 array vector is indeed made on a different grid then the "B" vector. from this 970 element vector I am interested only in about 20 of the lines. The others are noise or very faint lines in that I don't care but I take them in order to represent my experiment more accurate.

The "B" vector is the spectra from the 1024 pixel IR detector so it has 1024 elements.

I want to cross-correlate A and B. that means I have to "extend" the A vector to 1024 elements with out harm the relative distances between those 20 lines. in other words I need to increase the resolution of this vector without damage the intensity of the lines... interpol(A) just make the plot look very different from the original.

Craig, now I can see that you are right...
Vector B extracted from the spectrograph is probably irregular in the sense that the wavelength solution from pixel 1 to pixel 1024 is not linear witch is not the case for the intensity and wavelength base extracted from HITRAN. There the teluric lines are equidistant all over the array for A and for the B vector the may vary a bit over the array on the wave length solution from the pipeline .
In order to cross-correlate correctly two of the vectors B and the expanded A must be on the same grid is that right?

I have to do the same for the stellar lines synthetic template mask, but ones I am done with this I will do it much more easy!

As I can see in "interpol" program is written "....Linearly interpolate vectors with a regular or IRREGULAR grid."

Witch I am not sure "congrid" does.
However I have to experiment....

At last I need a function that will keep the nice shape the intensity lines like "congrid" and to be capable to "interpolate" in irregular grids so I can put in the end the two vectors in the same wavelength or pixel grid and to cross-correlate them.

I really hope I was clear.... I will experiment with "congrid" and also with you suggestions Craig...

I hope I will find the answer of my problems alone, but more help is always welcome and appreciate.

All the best,
Tito
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Question about storing arrays in pointer array.
Next Topic: Re: using cgSurface to produce a scatter 3D plot with 4th dimension

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

Current Time: Thu Oct 09 08:31:09 PDT 2025

Total time taken to generate the page: 3.03569 seconds