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

Home » Public Forums » archive » Re: performing multiple histograms without loops
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: performing multiple histograms without loops [message #69679 is a reply to message #69616] Wed, 03 February 2010 13:47 Go to previous messageGo to previous message
JDS is currently offline  JDS
Messages: 94
Registered: March 2009
Member
On Feb 2, 12:25 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> I thought it would be worth expanding on the technique that I used in
> response
> to Ed's question, because it's a very useful one. The basic idea is
> this:
> suppose I want to use HISTOGRAM not on one a single set of N data
> points, but
> independently on multiple (say M) sets each of N data points. The
> simple solution
> is to use a for loop, but if M is large the IDL loop penalty soon
> becomes a problem. Is it possible to avoid a loop?
>
> The answer is yes, and the trick is to modify the data in each of the
> M data
> sets so that they don't overlap, and then use a single HISTOGRAM on
> all
> of them at once.

It's a good method... in fact, you've essentially rediscovered the
algorithm employed by HIST_ND (which itself elaborated on IDL's own
HIST_2D). The M sets of N data points constitute a second dimension
(which don't really need to correspond to physical dimensions of any
sort... they could just be "M different sets numbered 0..M-1"). If
you follow through the dimensional analogy, you can also more easily
extract the "sub-histogram" by dumping the raw output into an
appropriately dimensioned array.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How 2 read a matrix to a widget?
Next Topic: questions onn symbol and fonts

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

Current Time: Thu Oct 09 22:12:30 PDT 2025

Total time taken to generate the page: 1.52797 seconds