function makecirc, f, a on_error,2 ;Return to sender if broken ;;; Extract relevent parameters from A xo = a[0] ;x centroid yo = a[1] ;y centroid r = a[2] ;radius ;;; How big is the input array? sz = size(f, /dimen) xsize = sz[0] ysize = sz[1] ;;; Construct abscissa values and fan 'em out x = indgen(xsize) y = indgen(ysize) x = rebin(x, xsize, ysize) y = rebin(reform(y, 1, ysize), ysize, xsize) ;;; In or out? w = where((x - xo)^2 + (y - yo)^2 le r^2, nw) ;;; A little trickery, make MASK the same size as F, but fill with ;;; zeros. A job for fltarra? Nah. mask = f*0 ;;; Insert 1's in the appropriate places if nw gt 0 then mask[w] = 1 return, mask end