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

Home » Public Forums » archive » Re: Reading binary data whose source code not given
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 binary data whose source code not given [message #2080] Wed, 18 May 1994 09:59 Go to previous message
rlefevre is currently offline  rlefevre
Messages: 4
Registered: April 1994
Junior Member
In article <2rd8ft$hn2@mojo.eng.umd.edu> madabhus@eng.umd.edu (Rajiv Madabhushi) writes:

> I have a binary file with a 400 by 400 array. All I know about the
> elements of that array is that they are written as 16-bit 2's complement
> data. The file was created on a pc. I am no sure about what language
> the software that creates this file is written in (and cannot
> find out :-( ).

> None of the above attempts proved successful. (I compared the image plot
> with that from an ascii version of the file. The two plots are completely
> different. The binary data is read in ok - without any keywords - but none
> of the data points are read in correctly.)

> So my question is: is there any way to read such data? I would be willing
> (and I also tried, but unsuccessfully) to read the data element by element.

Yes, I think.
I read data from Unix F77 on my IDL for the PC. I have to use the function
byteorder and keyword /lswap. For example,

readu,unit,isize,data,isize & byteorder, data, /lswap

where isize is the size byte used by f77 unformatted write and data is the
data.

Hope this helps.
----------
Randy J. Lefevre
Return e-mail to rlefevre@tamu.edu
[Message index]
 
Read Message
Read Message
Previous Topic: Reading binary data whose source code not given
Next Topic: GIF reader/writer for IDL

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

Current Time: Wed Oct 08 20:04:58 PDT 2025

Total time taken to generate the page: 0.00427 seconds