Hello
I am a beginner at IDL and I have a problem with writing a simple array to binary files using writeu. Writing the same file in ASCII works fine, but I cannot read a binary file written with writeu (I think there are type conversion errors -why?). The documentation on IDL basics is dreadful, hence I am writing to this group. Here is my code:
pro bwriteu2
close, /all
file_output2='banana_binary.out'
file_output3='banana_ascii.out'
openw,2,file_output2
openw,3,file_output3
nrows=89.0
ncols=89.0
my_array=fltarr(nrows, ncols)
for e=0.0, nrows-1. do begin
for f=0.0, ncols-1. do begin
my_array(f,e)=(1+f)*(1+e)
my_array(f,e)=float(my_array(f,e))
endfor
endfor
for k=0.0, nrows-1. do begin
for l=0.0, ncols-1. do begin
writeu,2,my_array(l,k)
printf,3,my_array(l,k)
endfor
endfor
close,/all
stop
end
The ASCII file is written in one column fine, but the binary is not - why?
Thanks a lot if you reply
Eddie Graham
|