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

Home » Public Forums » archive » Fortran unformatted data: Big or little endian
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
Fortran unformatted data: Big or little endian [message #34961] Wed, 30 April 2003 05:37 Go to next message
Michael Schroeter is currently offline  Michael Schroeter
Messages: 5
Registered: January 2002
Junior Member
Hello Newsgroup,

I have a problem reading Fortran unformatted data in IDL. I have a file
containing data of well known size (e.g., an array of 100 x 100 single
precision floating point values). Unfortunately, I don't know something
about the machine (big or little endian machine) on which the file has
been produced. Is there a way to get this information on the fly by IDL
in order to open the file automatically in the correctly (using the
/SWAP_ENDIAN option or not). The way I used so far was trial and error.
But since I have many of those files I'm searching for a solution
without recompiling my source code.

Do you have any ideas?

Thanks in advance.

Regards

Michael

------------------------------------------------------------ ----------
Institute of Meteorology and Climatology University Hannover/Germany
Herrenhaeuser Str. 2, 30419 Hannover
http://www.muk.uni-hannover.de
Re: Fortran unformatted data: Big or little endian [message #35014 is a reply to message #34961] Mon, 05 May 2003 05:37 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Schroeter (schroeter@muk.uni-hannover.de) writes:

> On my machines (IDL5.6, Red Hat Linux and hpux10.20) "readu" returns an
> error ("Corrupted f77 unformatted file detected") if I swap to the wrong
> endian-ness at the opening procedure.

Looks like RSI has built the magic number into
the F77 reading code already. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: chi-squared of poly_fit and polyfitw results
Next Topic: Re: Fortran unformatted data: Big or little endian

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

Current Time: Wed Oct 08 15:36:37 PDT 2025

Total time taken to generate the page: 0.00553 seconds