On Dec 5, 4:40 pm, David Fanning <n...@dfanning.com> wrote:
> Britta writes:
>> The first column are seconds, second column - hour, third - minutes,
>> fourth - seconds (if idl doesn't count column 2 to 4 as one column) ,
>> sixth to tenth - data output from the spectrometer. The result of
>> colMeans(6) should be approximately 136 (more or less :-), in the
>> original file there are a lot more columns and also more rows). For
>> print, colMeans(6) i obtain 1974.44. :-(
>
> Well, if I take the data you sent me, and I run the program
> I sent you, then this is what I get:
>
> IDL> print, colmeans(6)
> 135.808
>
> So, I don't know what the problem might be.
>
> You will have a problem with that first column, since IDL won't
> read a number with two decimal points in it, but that is not
> changing things otherwise, and if you are not using the first
> column, I wouldn't worry about it.
>
>> Is the value 2 in colMeans = Total(data, 2)/rows the number of
>> dimensions? Why do i use 2? To obtain a 1-dimensional array (scalar)
>> as a result?
>
> The two indicates that the total should be obtained over the
> 2nd dimension. That is, over the rows. In other words, add up
> the values in the columns.
>
>> I'm quite sure that these are really stupid questions for you, so
>> thank you for your patience.
>
> No, the stupid questions I refuse to answer. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Hi,
this really confuses me. Sometimes i think i have a bad aura
concerning computers :-). If you agree I would send you the original
file for a short test, because at the moment i have no idea what my
mistake is.
The syntax I use is the copy of your suggestion (see below):
------------------------------------------------------------ ---
rows = File_Lines('PATH\FILENAME.dat')
Openr, lun, 'PATH\FILENAME.dat', /Get_Lun
line = ""
ReadF, lun, line
cols = N_Elements(STRSPlit(line, ' ', /Extract))
Point_lun, lun, 0
data = FltArr(cols, rows)
ReadF, lun, data
Free_Lun, lun
colMeans = Total(data, 2)/rows
print, colMeans(6)
end
------------------------------------------------------------ --------
Cheers,
Britta
|