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

Home » Public Forums » archive » Re: percentile with dimension keyword
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: percentile with dimension keyword [message #76988 is a reply to message #76979] Tue, 19 July 2011 07:34 Go to previous messageGo to previous message
Kim is currently offline  Kim
Messages: 19
Registered: January 2009
Junior Member
On Jul 19, 9:42 am, Ben Tupper <ben.bigh...@gmail.com> wrote:
>
> Now that I think of it, have you searched for a function called
> percentile.pro?  It might be worth looking for that as a starting point.
>
> Cheers,
> Ben



; PERCENTILE: This Function returns the Values of data Corresponding
to input Percentiles
; NOTE: The Values returned are linear interpolates of the
sorted data
; EXAMPLE: DATA=FINDGEN(1001) & PRINT,
PERCENTILE(DATA,PERCENT=[0,0.01,1,10,50,98,99.9,100.0])

FUNCTION PERCENTILE,DATA,PERCENT=PERCENT,MISSING=MISSING,ERROR=error

IF N_ELEMENTS(PERCENT) EQ 0 THEN PERCENT = FINDGEN(101)
INDEX = INTERPOL([0.0,100.0],N_ELEMENTS(DATA)) ; Normalize INDEX
FROM 0 to 100 percent
VALUES = INTERPOL(DATA(SORT(DATA)) ,INDEX , PERCENT)
IF N_ELEMENTS(VALUES) EQ 1 THEN RETURN, VALUES(0) ELSE RETURN,
VALUES

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MIP from BMP Images
Next Topic: Re: cgSnaphot doesn't detect currently open windows

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

Current Time: Sat Oct 11 15:29:13 PDT 2025

Total time taken to generate the page: 2.72192 seconds