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

Home » Public Forums » archive » reading binary file with READ_BINARY
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 file with READ_BINARY [message #86199 is a reply to message #86190] Thu, 17 October 2013 06:46 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mishooax@gmail.com writes:

> I am trying to read a binary file in IDL containing a simple 2D array of 360x180 values. For reference, the binary file can be found here:
>
> http://transcom.project.asu.edu/download/transcom03/smoothma p.fix.2.bin
>
> Here is what the readme for this .bin says:
>
> The file 'smoothmap.fix.2.bin' contains a single real, binary
> array dimensioned 360 x 180. The array contains the numbers 1
> through 22, denoting each of the 22 basis functions in the
> TransCom 3 experiment. This file was written on an SGI Origin
> 2000 hosting UNIX.
>
> How can I read in this file correctly?

I would read it like this.

file = 'smoothmap.fix.2.bin
OpenR, lun, file, /Get, /Swap_If_Little_Endian
data = FltArr(260, 180)
ReadU, lun, data
Free_Lun, lun

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Synchronizing xrange of cgZPlot with another plot
Next Topic: quirk End of file encountered before end of program

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

Current Time: Wed Oct 08 17:29:21 PDT 2025

Total time taken to generate the page: 0.00472 seconds