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 #42140] Tue, 21 December 2004 15:13 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <cqa9h7$3np$1@news.tamu.edu>, "Jaehyung Yu" <jaeyu@tamu.edu>
wrote:

> Dear all,
>
> 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> READU, lun, bal_flux

> 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.
>
> Sincerely,
>
>

You forgot to read bal_flux. This assumes the F77 file was written with
two WRITES. It should have ((1400 x 1400) + 2 + 4) x 4 bytes.

Ken Bowman
[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: Sun Oct 12 05:38:58 PDT 2025

Total time taken to generate the page: 1.91887 seconds