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

Home » Public Forums » archive » Re: Read binary data
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: Read binary data [message #61372] Wed, 16 July 2008 09:21 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Jul 16, 11:13 am, Spon <christoph.b...@gmail.com> wrote:
> On Jul 16, 4:50 pm, xiao zhang <littledd...@gmail.com> wrote:
>
>> HI~ every one ~
>> I am trying to read a binary file which is 17920168 bytes and the
>> first 168 bytes of it is header infromation, The rest of it is
>> 800*800*14 two bytes integer. (like a 3 dimention array.) Can any
>> one help me to read it out ? There should not be so many zeros in it,
>> but i tried several times it still shows a lot of zero.
>> Thanks~
>
> OpenR, Lun, MyFile, /Get_Lun
> Point_Lun, Lun, 168
> MyData = Intarr(800, 800, 14, /NoZero)
> ReadU, Lun, MyData
> Free_Lun, Lun
>
> OR:
>
> MyData = Read_Binary(MyFile, Data_Type = 2, Data_Start = 168, $
> Data_Dims = [800, 800, 14])
>
> The advantage of the first method is that it's fast. The advantage of
> the second method is that if you're running into little/big endian
> issues, you can simply set the endian keyword as needed.
>
> Here's a helpful article if you're not sure:http://www.dfanning.com/tips/endian_machines.html
>
> Regards,
>
> Chris

Thank you very much I will try it~
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL 7 bookmarks
Next Topic: Save File Surprise

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

Current Time: Wed Oct 08 17:09:47 PDT 2025

Total time taken to generate the page: 0.00403 seconds