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

Home » Public Forums » archive » Binary Files
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
Binary Files [message #23926] Wed, 28 February 2001 15:09 Go to next message
Mike Garrett is currently offline  Mike Garrett
Messages: 3
Registered: November 2000
Junior Member
Hey all,

I am trying to read some binary files that I created using the unformatted
write in fortran90. The only problem is that these are the REAL variable
type and I don't know how to read these in IDL. I looked for some
documentation on the lenght of this data type but I didn't have any luck.
Has anyone else already done this?

Thanks

Mike
Re: Binary Files [message #24018 is a reply to message #23926] Thu, 01 March 2001 01:55 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
>>>> >>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 28/02/01, 23:09:44, Mike Garrett <hiss@eagle.cc.ukans.edu> wrote
regarding Binary Files:


> Hey all,

> I am trying to read some binary files that I created using the
unformatted
> write in fortran90. The only problem is that these are the REAL variable
> type and I don't know how to read these in IDL. I looked for some
> documentation on the lenght of this data type but I didn't have any luck.
> Has anyone else already done this?

> Thanks

> Mike

I'm assuming here that FORTRAN90 works the same as FORTRAN77. I've never
used
it myself.

Reading F77 unformatted data is usually pretty straight forward. Look in
the
help system index (idhlhelp) for "FORTRAN" and this should put you on the
right
track to reading FORTRAN unformatted data. IDL float should equate to
FORTRAN
REAL*4, and IDL double to REAL*8. The size of the plain REAL and DOUBLE
PRECISION
in FORTRAN may depend on whether your OS is 32 or 64 bits.

This should work for the supported UNIX systems. However, if you have
transferred
the FORTRAN unformatted file from another platform which has a different
endianness then you will have more fun to come.

I have no idea what will happen on Windows. BSOD probably, that seems to
be it's
usual response ;-)

--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
Re: Binary Files [message #24023 is a reply to message #23926] Wed, 28 February 2001 17:08 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Mike Garrett <hiss@eagle.cc.ukans.edu> writes:

> Hey all,
>
> I am trying to read some binary files that I created using the unformatted
> write in fortran90. The only problem is that these are the REAL variable
> type and I don't know how to read these in IDL. I looked for some
> documentation on the lenght of this data type but I didn't have any luck.
> Has anyone else already done this?

I know that OPENR has a fortran-specific keyword. And of course READU
can read unformatted real data directly. Have you checked these out?

In IDL, FLOAT is 4 bytes, and DOUBLE is 8 bytes.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: imaging Complex numbers
Next Topic: GOT IT!

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

Current Time: Thu Oct 09 16:05:15 PDT 2025

Total time taken to generate the page: 0.72097 seconds