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

Home » Public Forums » archive » How to make IDL faster
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: How to make IDL faster [message #36865 is a reply to message #36775] Wed, 29 October 2003 13:28 Go to previous messageGo to previous message
Ken Knapp is currently offline  Ken Knapp
Messages: 14
Registered: April 2003
Junior Member
My two cents:
Only loop over the rainfall data (k). Use rebin and reform to create
large (and constant) arrays, then simply difference the arrays to find
where the lat and lon matchup:

nelem = 207
nscan = 2985

trmmlat = reform(geo(0,*,*))
trmmlon = reform(geo(1,*,*))
trmmtb = reform(highf(0,*,*))

for k=0,di(0)-1 do begin
;remap the 1 lat value to match the trmmlat coordinates
lat = rebin(reform([lat(k)]),1,1),nelem,nscan)
lon = rebin(reform([lon(k)]),1,1),nelem,nscan)
match = where(abs(lat-trmmlat) lt 0.04 and $
abs(lon-trmmlon) lt 0.04,nmatch)
if (nmatch gt 0) then begin
for im=0,nmatch-1 do begin
print,loc(k),lon(k),lat(k),rain1(k),$
rain(k),trmmtb(match(im))
endfor
endif
endfor


Park Kyung Won wrote:

> Hello
> I write message first time.
> If I want to compare trmm satellite data with ground point data,
> I used to this line.
>
> geo(0,207,2985) : trmm latitute
> geo(1,*,*) : trmm longitute
> lat : ground location(latitute)
> lon : ground location(longitute)
> rain : automatic weather system rainfall data
> highf(0,207,2985) : trmm brightness temperature data
>
> for i=0,207 do begin
> for j=1200,1700 do begin
> for k=0,di(0)-1 do begin
>
> if geo(0,i,j) gt lat(k)-0.04 and geo(0,i,j) lt lat(k)+0.04 and $
> geo(1,i,j) gt lon(k)-0.04 and geo(1,i,j) lt lon(k)+0.04 then begin
> printf,lun3,loc(k),lon(k),lat(k),rain1(k),rain(k),highf(0,i, j)
> endif
>
> endfor
> endfor
> endfor
>
> When I caculate 26 trmm data, I wait almost 2hour.
> How can I change this program?
> Help me.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Solving nonlinear equations
Next Topic: vector t-test?

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

Current Time: Wed Oct 08 18:43:05 PDT 2025

Total time taken to generate the page: 0.00221 seconds