Reading Fortran binary files

D

drife

Hello,

I need to read a Fortran binary data file in Python.
The Fortran data file is organized thusly:

nx,ny,nz,ilog_scale # Record 1 (Header)
ihour,data3D_array # Record 2

Where every value above is a 2 byte Int. Further, the
first record is a header containing the dimensions of
the data that follows, as well as the scaling factor
of the data (log base 10). The second record contains
the hour, followed by the 3D array of data, which is
dimensioned by nx,ny,nz.

I also need to convert all the 2 byte Int values to
'regular' Int.

I realize that similar questions have previously been
posted to the group, but the most recent inquiries date
back to 2000 and 2001. I thought there may be newer and
easier ways to do this.


Thanks in advance for your help.


Daran Rife

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top