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

Home » Public Forums » archive » Re: Binary Output/Input From/To IDL on PC??????
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: Binary Output/Input From/To IDL on PC?????? [message #1964] Wed, 20 April 1994 22:56
cnlenz is currently offline  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 Go to previous message
HADFIELD[1] is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HDF routines
Next Topic: Plotting Color Strips - thermograms.

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

Current Time: Thu Oct 09 20:00:12 PDT 2025

Total time taken to generate the page: 0.88079 seconds