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

Home » Public Forums » archive » Re: reading f77_unformatted and writing it as ascii file
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: reading f77_unformatted and writing it as ascii file [message #42141 is a reply to message #42140] Tue, 21 December 2004 15:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jaehyung Yu writes:

> I downloaded f77_unformatted data file and tried to extract the information
> to ascii format.
>
> However, the output file I extracted has only one value of "0".
>
> The dataset is 1400x1400 float array. I used the following lines. Can
> somebody help me what I did wrong?
>
> Thank you in advance.
>
> IDL> file = 'bal_flux.bas_smooth35'
> IDL> openr, lun, file, /f77_unformatted, /get_lun
> IDL> nx = 0L & ny = 0L
> IDL> readu, lun, nx, ny
> IDL> print, nx, ny
> 1400 1400
> IDL> bal_flux = fltarr(nx, ny)
> IDL> help, bal_flux
> BAL_FLUX FLOAT = Array[1400, 1400]
> IDL> free_lun, lun
> IDL> outfile = 'outfile.txt'
> IDL> openw, lun_out, outfile, /get_lun
> IDL> printf, lun_out, bal_flux
> IDL> free_lun, lun_out
>
> Your help is very important and urgent to me.

Uh, I think you forgot to read the data into
your bal_flux array. You have made it the right
size (and you have filled it with zeros), but
you didn't read the data out of the file.
You probably need another READU in there
somewhere. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: reading f77_unformatted and writing it as ascii file
Next Topic: questionable display of an IDLgrPolygon Object with some transparency

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

Current Time: Mon Dec 01 01:30:26 PST 2025

Total time taken to generate the page: 1.36787 seconds