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

Home » Public Forums » archive » Re: Number of points within a rectangular region
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: Number of points within a rectangular region [message #36845 is a reply to message #36840] Fri, 31 October 2003 10:50 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Isa Usman wrote:
> 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
>
>

Hi,

You're mostly OK - but HISTOGRAM, and therefore HIST_ND, is sensitive to data
typing issues. Make sure that MIN, MAX and (if you were to use it) BINSIZE are
the same type as the input data.

Ben
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: types (conflict)
Next Topic: Re: Best Path Through a Vector Field

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

Current Time: Fri Oct 10 00:48:16 PDT 2025

Total time taken to generate the page: 0.88148 seconds