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

Home » Public Forums » archive » Partial summation of a data set!
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
Partial summation of a data set! [message #51373] Thu, 16 November 2006 00:20
kim20026 is currently offline  kim20026
Messages: 54
Registered: November 2006
Member
One more time, thanks for your invaluable suggestions for my previous
post. I have another data file with 50 columns * 8767 rows. This is a
part of it.
Day month year data1 data2 data3 ... data47
1 1 1981 ...
.
.
.
12 30 2005

What I am trying to do now is to add up the data in 28 to 35 columns in
each year. So what I have done so far is...

pro calout

;CONTROL VARIABLES
rootpath="D:\IDL_Documents\Temp\" ;working directory
ncol= 50
nrow= 8767
h=''
data=fltarr(ncol,nrow-1)

close, 1
openr, 1, rootpath + 'f1_grow_stratum.daily' ; This is my data file.
readf, 1, h
readf, 1, data
close, 1

years=reform(data[2,*]) ;3rd column is year.
values=reform(data[28:35,*])

for i=1981, 2005 do begin
chk=where(years eq i, n_chk)
if n_chk eq 0 then continue
print, 'Year :', i, ' -> Total = ', total(values[chk])
endfor
end
--------------------------
It seemed that there was no problem. No stop, no errors. However,
results were totally different form what I expected. Any suggestions or
comments? Thanks, in advance!!!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: voxelview
Next Topic: Re: voxelview

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

Current Time: Thu Oct 09 21:02:57 PDT 2025

Total time taken to generate the page: 1.03893 seconds