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

Home » Public Forums » archive » Re: 5th & 95th Percentiles
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: 5th & 95th Percentiles [message #58677] Thu, 14 February 2008 01:04 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On Feb 13, 5:04 pm, Spon <christoph.b...@gmail.com> wrote:

> pc5 = Data( (SORT(Data) ) (5 * N_ELEMENTS(Data) / 100) )
> pc95 = Data( (SORT(Data) ) (95 * N_ELEMENTS(Data) / 100) )

Please use

compile_opt defint32, strictarr

or

compile_opt idl2

at the beginning of each function (and in your IDL startup script) and
square braces for readability. For me at least it makes my head spin.
Consider the following instead:

pc5 = Data[ (SORT(Data))[5 * N_ELEMENTS(Data) / 100] ]

At least now it is clear which is which (array indexing vs. function
calling).

If you need both pc5 and pc95, be sure to store the sorted index:

sidx = sort(data)
ndata = n_elements(data)
pc5 = data[sixd[5*ndata / 100]]
pc66 = data[sixd[66*ndata / 100]]

Maarten
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: workbench project rename: bug?
Next Topic: Re: N_ELEMENTS gt 0

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

Current Time: Fri Oct 10 01:21:51 PDT 2025

Total time taken to generate the page: 0.80812 seconds