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

Home » Public Forums » archive » Re: opening/reading binary data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: opening/reading binary data [message #7177] Tue, 08 October 1996 00:00
hto is currently offline  hto
Messages: 15
Registered: April 1996
Junior Member
rawlins@strauss.udel.edu (Michael Alf Rawlins) wrote:

> Hi All,

> I'm somewhat of a novice with IDL, and am having some trouble reading
> a data file stored in binary mode. The data file is the etopo5
> elevation data. We run a Sun Sparc machine with SunOS 5.4 (UNIX)


> In IDL I did:
>
> IDL>openr,1,'Global/dem/etopo5.dat',f77_unformatted
> IDL>dat=fltarr(540,4320)
> IDL>readu,1,dat
>

I believe that etopo5 contains integer data -- 16 or 32 bit in feet or
meters. Try using either integer (16 bit) or long (32 bit) type in
IDL. If you can't solve it, let me know. I've read the file using
IDL but it was a long time ago. I can try to find the code.
Howard Onishi
Re: opening/reading binary data [message #7181 is a reply to message #7177] Mon, 07 October 1996 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Michael Alf Rawlins wrote:
> The FORTRAN open and read statements that work for
> this file are:
> open (13, file = '/usr2/home/rawlins/Global/dem/etopo5.dat',
> $ access = 'direct', recl = nlonnod*2)
> In IDL I did:
> IDL>openr,1,'Global/dem/etopo5.dat',f77_unformatted

Leave out the f77_unformatted keyword. It only applies to
FORTRAN unformatted *variable-length* records.

Cheers,
Liam.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Calling IDL(RSI) 4.01 from BC++4.51
Next Topic: Bug in Box_cursor?

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

Current Time: Wed Oct 08 19:14:22 PDT 2025

Total time taken to generate the page: 0.00686 seconds