function [p, x] = make_pupil(N,D)
%
% MAKE_PUPIL [p, x, rsq] = make_pupil(N,R)
%
%	r is the FFT cell size (in normalized pupil coordinates)
%  N is the number of points in the cell (should be power of 2)
%  D is the corresponding distance across the image. The pupil
%  itself has unit radius (diameter = 2).

x = (-N/2:N/2-1)*(D/N);
[xm ym] = meshgrid(x);
rsq = xm.*xm+ym.*ym;
p = rsq<=1.0;