Re: opening/reading binary data [message #7177] |
Tue, 08 October 1996 00:00 |
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  |
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.
|
|
|