% This is a green path
lambda=532e-9;
nFS=1.4607; %fused silica refractive index at 532nm.
goo = beamPath;


goo.seedWaist(500e-6, -0.1, 532e-9);


%%
d_rail_to_coupler = 170 * 1e-3; %mm (to middle of camera body)
d_rail = d_rail_to_coupler + [0, 10, 20, 30, 40, 50] * 1e-2;
x1 = [659, 705, 733,  775, 802, 843] /2 * 1e-6;
y1 = [664, 685, 719, 749, 780, 812] /2 * 1e-6;

goox = goo.fitBeamWidth(d_rail,x1);
gooy = goo.fitBeamWidth(d_rail,y1);

zplot = 0:.01:1;

clf
hold on
plot1 = goox.plotBeamWidth(zplot,'b')
plot2 = gooy.plotBeamWidth(zplot,'r')
plot(d_rail,x1,'bx')
plot(d_rail,y1,'ro')
legend([plot1 plot2],'x','y')
grid on
ylim([3e-4,6e-4])
xlabel('Distance from H:COL1')
ylabel('Beam radius [m]')
title('Beam profile out of H col')