 addpath C:\Users\sheila.dwyer\Documents\MATLAB\alm-master
close all
clear classes

%this is a temporary set up to inject p pol through tfp to SFI1 for
%isolation measurement, beam just needs to be roughly 400um through SFI1


col2BL1 = 0.44+0.15;  %distance from colimator to BL1, this can be changed
BL12SFI1 = (0.470-0.150)+0.135+0.125;

disp('Faraday starts at')
col2BL1+BL12SFI1

goo = beamPath;
goo.seedWaist(205e-6, -1.22, 1064e-9);  %mode out of F220FC-1064, measured in alog 57169
goo.addComponent(component.lens(1.0309, 0.1, 'PLCX 515.1'))  %try PLCX-25.4-515.1-UV-1064 
goo.addComponent(component.lens(778e-3, col2BL1, 'B:L1'))  %E2000077 +350mm ROC 
goo.addComponent(component.flatMirror(col2BL1+BL12SFI1, 'SFI1'))
goo.addComponent(component.flatMirror(col2BL1+BL12SFI1+0.130, 'SFI1e'))
%B:M1 is at 0.44+0.47meters from collimator 0.91 meters
%thin film polarizer 1.045
% Faraday rotator starts at 1.17, goes to about 1.3m

zdomain = -0.1:.01:2;
figure(1)
goo;
hold on
goo.plotBeamWidth(zdomain,'k')
goo.plotWaists(zdomain)
goo.plotComponents
xlabel('meters from collimator')
ylabel('beam radius [m]')

saveas(gcf, 'beam_prop_SFI1_iso_meas.png')
%see locations of measurements in 58126
R=0.44/(0.44+0.4)

