The dat files are byte arrays of 0 and 1 in equirectangular projection (4320 x 2160) = 360 x 180. width = 4320 nx = width ny = width/2 mapz = bytarr(nx,ny) outfile = outdir+'/'+regions[i].id+'.dat' openw,1,outfile writeu,1,mapz close,1