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

Home » Public Forums » archive » Number of points within a rectangular region
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Number of points within a rectangular region [message #36846] Fri, 31 October 2003 10:30
Isa Usman is currently offline  Isa Usman
Messages: 13
Registered: October 2001
Junior Member
Hello,

I'm trying to get the indices to the points that fall within a rectangular
region. I'm aware of David Fanning's INSIDE routine that does this but
because I have got 100,000 points its going to involve a lot of looping. So
I decided to use the HIST_ND with reverse indices but its not giving me the
right results. What am I missing?

Thanks in advance.

Isa

IDL> x = [0.5,-0.5,-0.5,0.5]

IDL> y = [0.5,0.5,-0.5,-0.5]

IDL> z = transpose([[x],[y]])

IDL> result = hist_nd(z,min = [0,0], max = [1,1], nbins = 1, reverse_indices
= ri)

print, ri[ri[0]:ri[1]-1]

0 1 2 3
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: determing object type at runtime in IDL
Next Topic: path_sep() or where() crashing my idlde

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

Current Time: Thu Oct 09 22:28:13 PDT 2025

Total time taken to generate the page: 0.08207 seconds