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

Home » Public Forums » archive » Re: read_ascii for many rows / possible to create automatic names for variables
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: read_ascii for many rows / possible to create automatic names for variables [message #57147 is a reply to message #57142] Wed, 05 December 2007 06:48 Go to previous messageGo to previous message
britta.mey is currently offline  britta.mey
Messages: 14
Registered: August 2007
Junior Member
On Dec 5, 3:38 pm, David Fanning <n...@dfanning.com> wrote:
> bmey writes:
>> i'm still a beginner in programming, therefore the next question.
>
> I thought you might be. :-)
>
>> When i read the whole array, how can i then proceed? I want to calculate
>> for each pixel (each column) the arithmetic mean of the values and
>> store these mean values as a new variable.
>
> I would do something like this.
>
> rows = File_Lines('myfile.dat')
> Openr, lun, 'myfile.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
>
> 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,

thaks. I'll try and hope i will manage this :-).

Britta
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: array operations and memory consumption
Next Topic: pson + !p.multi + xyouts

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

Current Time: Sat Oct 11 12:30:53 PDT 2025

Total time taken to generate the page: 0.27894 seconds