

% ComputeVCMParametersATBC('UT2',2,2,OPL/2,0,-1) after redefining
% UTPupilBeforeDL
% in the code  ( )


%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% Effect of AT4-STS-VCM ROC=-1000mm
% Located on J2/DL4
% Test Samuel AT4-STS-J2-DL4 with VCMROC=-1000mm +PRIMET adjustment of COM12,
% distATPupFixVCM=67.77 instead of 25.5m
%Check ComputeVCMParametersATBC values for proper UTExitPupiluCoordinate
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


OPL=[120:-5:10 ];

radius=[];
PIN=[];
POUT=[];

for i=1:length(OPL);
    %ComputeVCMParametersATBC(TelescopeStation,DL,IP,DLPOS_mech,pupil Offset,-1)
[RadiusVCMGIP, DistanceInputPupil, DistanceExitPupil, DistanceExitPupilFixedVCM]=ComputeVCMParametersATBC('UT4',4,4,OPL(i)/2,0,-1)
radius=[radius,RadiusVCMGIP];
PIN=[PIN,DistanceInputPupil];
POUT=[POUT,DistanceExitPupil];

end;


% VCM radius  range [150 mm ... 2800 mm]
% 150 mm = software limit; Remark: hardware lower limit = 84 mm
% It is suggested to use a radius R = 2.800000e+000 m

h=figure(2);
set(gca,'FontSize',13);
plot(OPL,radius,'k',OPL,radius,'go',OPL,150e-3*ones(1,length(OPL)),'r',OPL,84e-3*ones(1,length(OPL)),'m',OPL,2800e-3*ones(1,length(OPL)),'r');grid
xlabel('OPL in m');ylabel('DL4-VCM ROC in m');
title(' DL4-VCM-ROC ; AT4-J2-DL4-Ip2 with Pin calibrated by PRIMET (COM12)')
legend(' DL4-VCM-ROC ')

h=figure(3);
set(gca,'FontSize',13);
plot(OPL,1./radius, 'k',OPL,1./(radius),'go',OPL,1/150e-3*ones(1,length(OPL)),'r',OPL,1/84e-3*ones(1,length(OPL)),'m',OPL,1/2800e-3*ones(1,length(OPL)),'r');grid
xlabel('OPL in m');ylabel('DL1-VCM Curvature in m-1');
title(' DL4-VCM-Curv ; AT4-J2-DL4-Ip2 with Pin calibrated by PRIMET (COM12)')
legend(' DL4-VCM-Curv ')