Home > pubtools > LatticeTuningFunctions > errors > DXDY > testerr.m

testerr

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear all
0002 close all
0003 
0004 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/errors')
0005 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/errors/errordisplayfunctions');
0006 
0007 % load lattice
0008 load ../../ESRFLattice.mat
0009 
0010 % get indexes
0011 indq=find(atgetcells(ring,'Class','Quadrupole'));
0012 
0013 % define alignemnt errors
0014 dx=1e-6*randn(size(indq)); % random errors of 1um
0015 dy=1e-6*randn(size(indq));
0016 
0017 % set errors
0018 ringerr=atsetshift(ring,indq,dx,dy);
0019 
0020 % plots
0021 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0022 atplot(ring,'comment',[],@plClosedOrbit)
0023 saveas(gca,'OrbitNoErr.fig')
0024 export_fig('OrbitNoErr.jpg','-r300')
0025 
0026 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0027 atplot(ringerr,'comment',[],@plClosedOrbit)
0028 saveas(gca,'OrbitWithErr.fig')
0029 export_fig('OrbitWithErr.jpg','-r300')
0030 
0031 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0032 atplot(ringerr,'comment',[],@pltmisalignments)
0033 saveas(gca,'SetErrDxDy.fig')
0034 export_fig('SetErrDxDy.jpg','-r300')
0035 
0036 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0037 atplot(ringerr,[0,52],'comment',[],@pltmisalignments)
0038 saveas(gca,'SetErrDxDyZoom.fig')
0039 export_fig('SetErrDxDyZoom.jpg','-r300')
0040

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005