psf

Contents

make pupil

clear;
N=256;
D=16;
[p x] = make_pupil(N,D);
imshow(p);

plot cross-section through prupil

% cross-section through center of pupil
ndx = find(x==0);
idx = find(abs(x)<2);
plot(x(idx),p(ndx,idx));
axis([-2 2 -0.1 1.1]);

show ideal psf

w = zeros(size(p));
z = psf(p,w);
logim(z,3);

compare to theoretical

xf = (-N/2:N/2-1)/D;
y = somb(2*xf).^2;
semilogy(xf(idx),z(ndx,idx),'o',xf(idx),y(idx),'k');
Warning: Imaginary parts of complex X and/or Y
arguments ignored

2-waves coma

[xg yg] = meshgrid(x);
w = (xg).*((xg.^2+yg.^2)-1);
z = psf(p,2*w);
logim(z,3);

strehl ratio

[y1 y2 xw] = strehl1(p,w);
sigma = xw/sqrt(72);
plot(xw,y1,xw,exp(-(2*pi*sigma).^2),'LineWidth',2);
grid;
xlabel('aberration magnitude (waves)');
ylabel('strehl ratio');