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

Home » Public Forums » archive » Re: How does one read in simple binary files?
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: How does one read in simple binary files? [message #5530] Mon, 15 January 1996 00:00 Go to previous message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
Several good examples were given but ....

thompson@achilles.nascom.nasa.gov (William Thompson) wrote:

> Yep.

> All you would need to do for your example of a 128x128 array would be the
> following:

> IDL> OPENR, UNIT, 'filename1', /GET_LUN


As the poster of the original question didn't not mention which
programing language was used to write the binary data I want to
point to an additional keyword for IDL's open procedures. It is
/fortran_77 which takes care of extra words the run time system
of Fortran adds for binary files. Binary Fortran files have the
record length of transferred record prepended and appended
to the record, *if the operating system is some Unix flavor*.
In following Fortran chunk will read 10 elements of a real array
from standard input and write it as one binary record on unit 27:
real x(10)
read(*,*) x
write(27) x
end
will result in 48 bytes being written: 4 bytes contain the record
length (40) as integer value, 40 data bytes follow, and then the
header is repeated.

> William Thompson

Norbert Hahn
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Idl is greedy, once it gets some memory it will NOT release it.
Next Topic: Producing graphics without screen display

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

Current Time: Sat Oct 11 21:43:14 PDT 2025

Total time taken to generate the page: 0.88322 seconds