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

Home » Public Forums » archive » Counting the number of iregular value in regular grid
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
Counting the number of iregular value in regular grid [message #54217] Fri, 25 May 2007 23:04
Nick[1] is currently offline  Nick[1]
Messages: 10
Registered: May 2007
Junior Member
I was trying to count the number of irregular data in regular grid.
I made code but it's too slow to calculate my lots of data.
Could you give me some advice to make this code more faster?
Thank you, Jungbin


;1 X 1 Grid
glon = -179.5 + findgen(360)
glat = 89.5 - findgen(180)

for j = 0, 359 do begin
if [ (lon(x)-0.5 ge glon(j)) and (lon(x)+0.5 lt glon(j)) ]
then begin
for k = 0, 179 do begin
if [ (lat(x)+0.5 le glat(k)) and (lat(x)-0.5 gt
glat(k)) ] then begin
if ( finite( value(j,k) ) eq 1 ) then nn(j,k) = nn(j,k)
+ 1
endif
endfor ;k
endif
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: object graphics: any similar tools already written?
Next Topic: IDL 6.4 is available

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

Current Time: Sat Oct 11 15:18:43 PDT 2025

Total time taken to generate the page: 0.55699 seconds