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

Home » Public Forums » archive » Re: calculating long term statistics on ALBEDO 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: calculating long term statistics on ALBEDO data [message #43308 is a reply to message #43306] Tue, 05 April 2005 09:01 Go to previous message
wita is currently offline  wita
Messages: 43
Registered: January 2005
Member
Hi Klaus,

You idea worked, I now have it implemented as follows:

;Main processing loop
FOR i=0L, num_tiles-1 DO BEGIN
envi_report_stat,base, i, num_tiles
data = envi_get_tile(tile_id1, i)
mask = envi_get_tile(tile_id2, i)
;Only execute at first iterations to get the data dimensions
IF i EQ 0 THEN BEGIN
ds = SIZE(data, /DIMENSIONS)
means = FLTARR(ds[0],36)
stdev = means
decades = LINDGEN(ds[1]) MOD 36
index = WHERE(decades EQ 0)
ENDIF
;Loop over Z direction
FOR k=0, 35 DO BEGIN
tmpindex = index+k
count = TOTAL(FINITE(data[*,tmpindex]),2)
tmpmeans = TOTAL(data[*,tmpindex],2,/NAN)/FLOAT(count)
tmpmeans2d = REBIN(REFORM(tmpmeans, ds[0], 1), ds[0], $
N_ELEMENTS(index))
tmpstdev = SQRT(TOTAL((data[*,tmpindex] - tmpmeans2d)^2, $
2, /NAN)/(count[*]-1))
means[*,k] = tmpmeans
stdev[*,k] = tmpstdev
ENDFOR
WRITEU, unit1, means
WRITEU, unit2, stdev
ENDFOR

It now runs in a fraction of the time compared to the previous version.

Thanks,

Allard
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: dimensional headache
Next Topic: Re: IDLWAVE xemacs Initialization problem

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

Current Time: Fri Oct 10 01:04:19 PDT 2025

Total time taken to generate the page: 0.55707 seconds