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

Home » Public Forums » archive » Re: Implied do loops in IDL
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: Implied do loops in IDL [message #2245 is a reply to message #2238] Wed, 15 June 1994 10:15 Go to previous messageGo to previous message
leic is currently offline  leic
Messages: 2
Registered: June 1994
Junior Member
It is possible to read FORTRAN binary as normal (ie. without the
/F77_unformatted keyword) provided you know how FORTRAN handles
the unformatted records.
I have to do this with data I use which is output in exactly the
same implied DO loop way as is your data.

On our system (SGI IRIX 5) FORTRAN prepends and appends 4 bytes
to each record. This is a long word byte count of the record
length.

To read this data back in use the following algorithm :

; Open the file as a normal data file:
OPENR, lun, /GET_LUN, file

; Define a long word byte count to read at the start and end of
; each record:
byte_count = 1L

; To read a single record, first read the byte count, then create
; an array of the necessary data type and size:
READU,lun, byte_count
data = LONARR(byte_count/4)

; Finally, read the array and the terminating byte count:
READU,lun, data,byte_count

I am pretty sure that SunOS also uses a 4byte prefix/postfix byte
count. The only real way to be sure is to use od to get a dump
of the first few records of the file and see what is in there.

Hope this helps.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Problems with Idl and Irix 5.2-alpha
Next Topic: Re: missing data

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

Current Time: Sun Nov 30 18:21:59 PST 2025

Total time taken to generate the page: 0.64293 seconds