Re: Binary Output/Input From/To IDL on PC?????? [message #1964] |
Wed, 20 April 1994 22:56 |
cnlenz
Messages: 10 Registered: April 1994
|
Junior Member |
|
|
>> I produce an array (145,73,10) in IDL. I open an output file (OPENW) and
>> write out binary data (WRITEU). I try to read the binary output into MS
>> Fortran PowerStation (on a PC). If I use a Fortran UNFORMATTED open, I get a
>> wrong file type error in Fortran. If I use a PowerStation BINARY open, it
>> works. However, only half the input array gets in, the other half is all 0s.
>> I think it has something to do with the "unformatted" data format.
I think you have to make shure what you write or read. Have you byta-data or
integer-data. You have also the possibility to write or read float-data.
good luck
Christian
|
|
|
Re: Binary Output/Input From/To IDL on PC?????? [message #1970 is a reply to message #1964] |
Tue, 19 April 1994 18:13  |
HADFIELD[1]
Messages: 9 Registered: March 1994
|
Junior Member |
|
|
In article <rlefevre.21.000AD756@tamu.edu> rlefevre@tamu.edu (Randy J. Lefevre) writes:
> I produce an array (145,73,10) in IDL. I open an output file (OPENW) and
> write out binary data (WRITEU). I try to read the binary output into MS
> Fortran PowerStation (on a PC). If I use a Fortran UNFORMATTED open, I get a
> wrong file type error in Fortran.
Not surprising. Fortran programs generally expect separator bytes at the
beginning or end of each record in an "UNFORMATTED" file. WRITEU in IDL
produces a "bare" format.
> If I use a PowerStation BINARY open, it
> works. However, only half the input array gets in, the other half is all 0s.
Is the number of bytes per array element the same in the IDL and PowerStation
programs? If you wrote IDL integer (2 byte) data and tried to read it
as Fortran INTEGER*4 data there would only be enough to fill the half the
array. (Most Fortran compilers default to a 4-byte form for integers.)
What machine is IDL running on? Does it have the same byte order
(little-endian) as the PC?
============================================================ ===========
Mark Hadfield hadfield@greta.niwa.cri.nz
NIWA Marine (Taihoro Nukurangi) NIWA.GRETA:HADFIELD
Wellington, New Zealand
|
|
|