0001 clear all
0002 close all
0003
0004
0005 load ../../ESRFLattice.mat
0006
0007
0008 indm=indBPM';
0009 indq=find(atgetcells(ring,'Class','Quadrupole'));
0010
0011
0012
0013 dx=1e-6*randn(size(indq));
0014 dy=1e-6*randn(size(indq));
0015 dt=1e-6*randn(size(indq));
0016
0017
0018 dox=1e-4*randn(size(indm));
0019 doy=1e-4*randn(size(indm));
0020 ox=1e-5*randn(size(indm));
0021 oy=1e-5*randn(size(indm));
0022 gx=1e-3*randn(size(indm));
0023 gy=1e-3*randn(size(indm));
0024 rx=1e-6;
0025 ry=1e-6;
0026 rot=1e-5*randn(size(indm));
0027
0028
0029 ringerr=ring;
0030
0031
0032 ringerr=atsetshift(ringerr,indm,dox,doy);
0033 ringerr=atsetbpmerr(ringerr,indm,ox,oy,gx,gy,rx,ry,rot);
0034
0035
0036 figure('units','normalized','position',[0.1 0.4 0.65 0.35])
0037 s=findspos(ringerr,indm);
0038 o=findorbit4(ringerr,0,indm);
0039 plot(s,o(1,:)'*1e6,'k');
0040 hold on;
0041 oe=findorbit4Err(ringerr,0,indm);
0042 plot(s,oe(1,:)'*1e6,'rx');
0043 legend('orbit','bpm reading');
0044 oe=findorbit4Err(ringerr,0,indm);
0045 plot(s,oe(1,:)'*1e6,'rx');
0046 oe=findorbit4Err(ringerr,0,indm);
0047 plot(s,oe(1,:)'*1e6,'rx');
0048 oe=findorbit4Err(ringerr,0,indm);
0049 plot(s,oe(1,:)'*1e6,'rx');
0050 oe=findorbit4Err(ringerr,0,indm);
0051 plot(s,oe(1,:)'*1e6,'rx');
0052 xlabel('s [m]');ylabel('x [\mum]')
0053 saveas(gca,'OrbitBPMAllErrX.fig')
0054 export_fig('OrbitBPMAllErrX.jpg','-r300')
0055
0056
0057 figure('units','normalized','position',[0.1 0.4 0.65 0.35])
0058 s=findspos(ringerr,indm);
0059 o=findorbit4(ringerr,0,indm);
0060 plot(s,o(1,:)'*1e6,'k');
0061 hold on;
0062 oe=findorbit4Err(ringerr,0,indm);
0063 plot(s,oe(1,:)'*1e6,'rx');
0064 legend('orbit','bpm reading');
0065 oe=findorbit4Err(ringerr,0,indm);
0066 plot(s,oe(1,:)'*1e6,'rx');
0067 oe=findorbit4Err(ringerr,0,indm);
0068 plot(s,oe(1,:)'*1e6,'rx');
0069 oe=findorbit4Err(ringerr,0,indm);
0070 plot(s,oe(1,:)'*1e6,'rx');
0071 oe=findorbit4Err(ringerr,0,indm);
0072 plot(s,oe(1,:)'*1e6,'rx');
0073 xlabel('s [m]');ylabel('y [\mum]')
0074 saveas(gca,'OrbitBPMAllErrY.fig')
0075 export_fig('OrbitBPMAllErrY.jpg','-r300')
0076
0077 figure('units','normalized','position',[0.1 0.4 0.65 0.35])
0078 atplot(ringerr,[0,100],'comment',[],@plClosedOrbitBPM);
0079 saveas(gca,'OrbitBPMAllErratplot.fig')
0080 export_fig('OrbitBPMAllErratplot.jpg','-r300')
0081
0082 return