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

Home » Public Forums » archive » Re: help with sorting vector elements in to subarrays
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: help with sorting vector elements in to subarrays [message #80223 is a reply to message #80217] Mon, 21 May 2012 13:22 Go to previous messageGo to previous message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
> You're not making much sense... How does zz=[5,6,9,10,11] sort into
> zz1=[5,6] and zz2=[9,10,11]? Are you just taking the first two and
> last three elements?
>
> Russell
>
> But, yes, uniq() is probably going to help you. Just remember, uniq
> only works correctly on arrays which are sorted!

Dear Greg and Russel,

I know the Uniq() routine. I try it several times with no success.

I am trying to select spectral lines with the same depths. It is a very long story why they are with the same depths....
As you can imagine amp[i] has a different values ranging from 0 to 1 for each wavelength thats why I cant Sort() them (at least I don't know how)


zz=[5,6,9,10,11] in particular 5,6 and 9,10,11 are the indexes of very close lines in the spectra and they are basically blended. Thats why I want to take them out from the array make a multigauss fit and the result Gaussian I will pass it again as one gaussian(Lorentzian actually) sum of the gaussians of line[5,6] or line[9,10,11]

this is just a simple example sometimes I have 4 close lines or 3-4 pairs.

with the above code [ugly I admit] I am taking out the closed lines in an array

zz=[5,6,9,10,11] but then i need to split it to zz1=[5,6] and zz2=[9,10,11]
this is all that i need in order to start the multigaussian fitting automatically.

I have huge amount of data and I want this to be automatic.

I am sure there is an easy way but this somehow is working and I am happy.

Anyway I will continue trying... any feed back is more than welcome.

Trifon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: VM Save File Problem
Next Topic: Re: help with mathematics

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

Current Time: Wed Oct 08 18:28:47 PDT 2025

Total time taken to generate the page: 0.00442 seconds