Re: problem reading Fortran binary file [message #70241] |
Thu, 25 March 2010 11:51 |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Mar 25, 3:50 pm, pp <pp.pente...@gmail.com> wrote:
> This is what you were asking, but I think the way you are reading it,
I meant to say "this is not what you were asking".
|
|
|
Re: problem reading Fortran binary file [message #70242 is a reply to message #70241] |
Thu, 25 March 2010 11:50  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
This is what you were asking, but I think the way you are reading it,
your Nphot_tab will have the elements messed up in it. Both IDL and
Fortran are row major, so when you read the data, the leftmost
dimension should vary the fastest. Also I think you could use just:
nrej = 0L
n = 0L
my_file = 'bfile.bin'
openr,unit,myfile,/get_lun,/f77_unformatted
readu,unit, nrej,n
Nphot_tab = dblarr(nrej,n)
readu,unit,Nphot_tab
free_lun,unit
You should also make sure that the data types match. Is your fortran
array data made of 64-bit reals? Are the fortran nrej and n 32 bit
integers?
|
|
|
|