Commit 1533cc35 authored by Simone Liuzzo's avatar Simone Liuzzo

additional inputs for qempanel

parent 1eac5237
No preview for this file type
This diff is collapsed.
......@@ -65,6 +65,8 @@ if ~isfield(mode,'vnorm')
% mode.vnorm=vv(okfit)';
end
mode.neigs=qemres.neigQuadFit;
mode.dispweight=qemres.hdispWeigth;
mode.tuneweight=qemres.tuneWeigth;
newkn=qemb.kn;
newkn(okfit)=qemb.kn(okfit)+qemerrfit(nhst,nvst,resp-resp0,dresp,mode,okbpm);
......
......@@ -83,6 +83,7 @@ if ~isfield(mode,'vnorm')
end
mode.neigs=qemres.neigQuadFit;
mode.dispweight=qemres.hdispWeigth;
mode.tuneweight=qemres.tuneWeigth;
newkn=qemb.kn;
newkn(okfit)=qemb.kn(okfit)+qemerrfit(nhst,nvst,resp-resp0,dresp,mode,okbpm);
......
......@@ -50,7 +50,20 @@ semres.skewkeep=true(1,288);
%semres.skewkeep(1)=false; % Do not touch kicker bump compensation
%semres.skewkeep(end)=false; % Do not touch kicker bump compensation
mach=atmod.ring;
try
stgs=load(fullfile(qemres.datadir,'settings.mat'));
qemres.tunes=stgs.tunes-fix(stgs.tunes);
qemres.fulltunes=stgs.tunes-fix(stgs.tunes);
catch
qemres.tunes=[0.21 0.34];
qemres.fulltunes=[76.21 27.34];
end
% % retune the model to measured tune
% qemres.at=reshape(atfittune(mach(:),qemres.tunes,'QF1\w*','QD2\w*'),size(mach));
% qemres.at=reshape(ebs.opticsmatching(mach,'mux',76+qemres.tunes(1),'muy',27+qemres.tunes(2)),size(mach));
atmod.settune(qemres.fulltunes,'QF1QD2');
mach = atmod.ring;
try
warning('missing skew quadrupoles and normal quadrupole correctors! ebs.read_mag returns correction strengths! not full strengths!')
......@@ -76,15 +89,6 @@ catch
warning('qem:noinit','Could not read sextupoles values from S.R. . KEPT as in reference optics, no corrections.');
end
try
stgs=load(fullfile(qemres.datadir,'settings.mat'));
qemres.tunes=stgs.tunes-fix(stgs.tunes);
catch
qemres.tunes=[0.21 0.34];
end
% % retune the model
% qemres.at=reshape(atfittune(mach(:),qemres.tunes,'QF1\w*','QD2\w*'),size(mach));
% qemres.at=reshape(ebs.opticsmatching(mach,'mux',76+qemres.tunes(1),'muy',27+qemres.tunes(2)),size(mach));
% no retuning
qemres.at=mach;
......
......@@ -2,7 +2,7 @@ function qemb = qemretune(qemb,qemres,tunes)
%QEMB=QEMRETUNE(QEMB,QEMRES) Retune
[k,tilt]=semtilt(qemb.kn,qemb.ks); %#ok<ASGLU>
mach=atfittune(qemb.at,tunes,'QD6','QF7');
mach=atfittune(qemb.at,tunes,'QF1\w*','QD2\w*');
knew=getcellstruct(mach,'PolynomB',qemres.qpidx,2);
qemb.kn=knew.*cos(2*tilt);
qemb.ks=-knew.*sin(2*tilt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment