function diskmask, dim, radius, center

if n_elements(center) le 0 then center = (dim-1)*0.5


Ncir = 1024

argcir = findgen(Ncir)/(Ncir-1)*!pi*2

xcir = center[0] + cos(argcir)*radius
ycir = center[1] + sin(argcir)*radius

mask1 = intarr(dim[0], dim[1])

mask1[polyfillv(xcir, ycir, dim[0], dim[1])] = 1

return, mask1

end
