Skip to main content

6.1) Binary Files


Binary data is read into IDL in a similar way to ASCII data. You need to know the exact structure of the file and create the data arrays to read the data into accordingly. It is then a case of using "readu" instead of "readf" to read the data in.

data = fltarr(360, 180)
myfile = 'mybinaryfile.dat'
openr, 1, myfile
readu, 1, data
close, 1