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

Home » Public Forums » archive » equal lat long 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
equal lat long grid [message #48327] Fri, 07 April 2006 08:43 Go to next message
Pawan is currently offline  Pawan
Messages: 9
Registered: April 2006
Junior Member
Hi all,

I was trying to convert my unequal size lat long data into equal size
lat long (grid) data.

Here is code that I am using. I was wondering if someone could give me
some idea on improving this. I have almost 2 M data points and this
code is taking more than 12 hour to do the job.

thanks,
pawan

;; Gridding data
;output arrays to store the data

mean_aot = fltarr(241,721) ; to store mean
std_aot = fltarr(241,721) ; to store stdev
min_aot = fltarr(241,721) ; to store min
max_aot = fltarr(241,721) ; to store max
cnt = fltarr(241,721)

starttime=systime(0)
for i = 0,240 do begin
lat = i * 0.5 - 60
for j = 0,720 do begin
lon = j * 0.5 - 180

res = where((param(6,*) gt (lat-0.25) and $
param(6,*) le (lat+0.25)) and $
(param(5,*) gt (lon-0.25) and $
param(5,*) le (lon+0.25)) and $
(param(25,*) ge 0. and param(25,*) le 5.) and $
param(10,*) gt 0. and $
param(17,*) gt 0., count)

if(count gt 0) then begin
mean_aot(i,j) = mean(param(17,res))
cnt(i,j) = count
std_aot(i,j) = 0.
if (count gt 1) then begin
std_aot(i,j) = stddev(param(17,res))
endif

;
printf,2,format='(7f10.3)',lat,lon,mswf(i,j),maot(i,j),cnt(i ,j),std_swf,std_aot

endif

endfor
print,lat
endfor
endtime=systime(0)
close,2
print,'Start Time :',starttime
print,'End Time :',endtime
end
Re: equal lat long grid [message #48585 is a reply to message #48327] Fri, 28 April 2006 11:52 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pawan writes:

> I am running this program on IDL_6.0 on Linux machine and it gives me
> error on the following location. IDL does not recognize indgen_array.
>
> glon = indgen_array(nlon, nlat, /lon) * dlon + lon0[0] + dlon / 2.
> glat = indgen_array(nlon, nlat, /lat) * dlat + lat0[0] + dlat / 2.
>
> I was wondering is this just indgen or some other thing you want to do
> here ?
>
> glon = indgen(nlon, nlat) * dlon + lon0[0] + dlon / 2.
> glat = indgen(nlon, nlat) * dlat + lat0[0] + dlat / 2.

You will have to download this from his web page. See his
previous post for a link to this file.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: equal lat long grid
Next Topic: IDL calling Fortran

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

Current Time: Wed Oct 08 17:39:07 PDT 2025

Total time taken to generate the page: 0.00426 seconds