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

Home » Public Forums » archive » Using histogram (or cghistogram) to get top X percent of distribution?
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: Using histogram (or cghistogram) to get top X percent of distribution? [message #92626 is a reply to message #92620] Tue, 26 January 2016 07:46 Go to previous messageGo to previous message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
On Monday, January 25, 2016 at 2:48:23 PM UTC-7, rj...@le.ac.uk wrote:
> I'm not sure if this is just me not quite understanding how histogram works.
>
> I have a large array containing data. I want to identify the array indices of the top 10% (for example) of the data. I thought I should be able to use histogram to do this quickly but can't figure out how.
>
> Any help much appreciated as always :-)

If all you need are the indices of the top 10% of the data, you can also just do

IDL> s = sort(data)
IDL> idx = s[round(0.9*n_elements(s))+1:*]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: USE of IDL in cl script for iraf???
Next Topic: DIST Function - 3D

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

Current Time: Wed Oct 08 15:59:30 PDT 2025

Total time taken to generate the page: 0.00261 seconds