0001
0002 close all
0003 clear all
0004 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions');
0005 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/correction/response matrix')
0006 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/correction/');
0007 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/errors/');
0008
0009
0010 s28d=load('/machfs/liuzzo/EBS/S28D/LATTICE/AT/S28Dmerged_PA.mat');
0011
0012 ring=s28d.LOW_EMIT_RING_INJ;
0013 [l,t,c]=atlinopt(ring,0,1);
0014 r0=ring;
0015
0016
0017 indqf1=find(atgetcells(ring,'FamName','QF1\w*'));
0018 ring=atsetfieldvalues(ring,indqf1,'ForTuneF',1);
0019 indqd2=find(atgetcells(ring,'FamName','QD2\w*'));
0020 ring=atsetfieldvalues(ring,indqd2,'ForTuneD',1);
0021
0022
0023 ind=find(atgetcells(ring,'Class','Quadrupole','Sextupole'));
0024 dx=5e-6*randn(size(ind));
0025 dy=5e-6*randn(size(ind));
0026
0027 rerr=atsetshift(ring,ind,dx,dy);
0028
0029
0030 rerr=fittunedelta2fam(rerr,r0);