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

Home » Public Forums » archive » ROI's and geographical data!
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: ROI's and geographical data! [message #35368 is a reply to message #35269] Thu, 05 June 2003 08:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Einar Einarsson (einare@hi.is) writes:

> The only solution I see is making a loop testing each point, something
> like:
>
> IF roi->ContainsPoints(lon_fin[j], lat_fin[j]) GT 0 THEN BEGIN
> dat_end[i]=dat_exp[j]
> lon_end[i]=lon_fin[j]
> lat_end[i]=lat_fin[j]
> i = i+1
> ENDIF
>
> wich is not very good inside a loop with huge data sets.

There is no reason to do this in a loop (unless you
are consciously trying to slow everything down). The
ContainsPoints function has already been vectorized.
I would try something like this:

pts= roi->ContainsPoints(lon_fin, lat_fin)
inside_pts = Where(pts GT 0, count)
IF count GT 0 THEN BEGIN
lon_end = lon_fin[inside_pts]
lat_end = lat_fin[inside_pts]
ENDIF

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDL 6.0 beta printer woes
Next Topic: Re: vfw for idl

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

Current Time: Thu Dec 04 23:45:38 PST 2025

Total time taken to generate the page: 1.20547 seconds