Commit 01ea265f authored by Simone Liuzzo's avatar Simone Liuzzo

hopefully finally corrected definition of pinholes order

parent 973a10c6
......@@ -2,7 +2,7 @@ function qemb = qemoptics(qemres,qemb,qemb0)
%QEMOPTICS Compute optical parameters for the fitted machine
nbpm=length(qemres.bpmidx);
[idx,j,kdx]=unique([qemres.bpmidx qemres.d01idx qemres.id07idx qemres.d17idx qemres.id25idx qemres.d27idx]); %#ok<ASGLU>
[idx,j,kdx]=unique([qemres.bpmidx qemres.id07idx qemres.d17idx qemres.id25idx qemres.d27idx qemres.d01idx]); %#ok<ASGLU>
orbit0=findsyncorbit(qemb.at,qemres.ct,qemres.bpmidx);
dpp=orbit0(5,1);
......@@ -11,11 +11,11 @@ dpp=orbit0(5,1);
lindata=lindata(kdx);
qemb.lindata=lindata(1:nbpm); % BPM results
qemb.d01data=lindata(nbpm+1); % D01 results
qemb.id07data=lindata(nbpm+2); % ID07 results
qemb.d17data=lindata(nbpm+3); % D17 results
qemb.id25data=lindata(nbpm+4); % ID25 results
qemb.d27data=lindata(nbpm+5); % D27 results
qemb.id07data=lindata(nbpm+1); % ID07 results
qemb.d17data=lindata(nbpm+2); % D17 results
qemb.id25data=lindata(nbpm+3); % ID25 results
qemb.d27data=lindata(nbpm+4); % D27 results
qemb.d01data=lindata(nbpm+5); % D01 results
dispersion=cat(2,qemb.lindata.Dispersion)';
qemb.tunes=qemb.pm.fulltunes;
qemb.beta=cat(1,qemb.lindata.beta);
......@@ -32,7 +32,7 @@ qemb.emittances=[modemit(:,1:2) cat(1,lindata.emit44)];
qemres.brot,qemres.bhgain,qemres.bvgain,orbit0);
if nargin >= 3
lindata0=[qemb0.lindata qemb0.d01data qemb0.id07data qemb0.d17data qemb0.id25data qemb0.d27data];
lindata0=[qemb0.lindata qemb0.id07data qemb0.d17data qemb0.id25data qemb0.d27data qemb0.d01data];
beta0=cat(1,lindata0.beta);
beam66=cat(3,lindata.beam66);
sigma2=[squeeze(beam66(1,1,:)) squeeze(beam66(3,3,:))];
......
......@@ -22,7 +22,7 @@ function varargout = qempanel2(varargin)
% Edit the above text to modify the response to help qempanel2
% Last Modified by GUIDE v2.5 08-Feb-2019 10:08:30
% Last Modified by GUIDE v2.5 08-Feb-2019 15:41:54
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
......@@ -982,5 +982,3 @@ waitfor(set(handles.statustext,'String','figures are being redrawn'));
qempaneldisp(qemres,semres,qemb(2),qemb(1),handles);
set(handles.statustext,'String','new figures done');
......@@ -3,30 +3,32 @@ function mess=semdisp(qemb,qemres,semres)
nbpm=length(qemres.bpmidx);
alllist=1:nbpm; % all BPMS
% this order should be identical to the one in qemoptics.m
d01=nbpm+1; % D01 pinhole
id07=nbpm+2; % ID07
d17=nbpm+3; % D17
id25=nbpm+4; % ID25
d27=nbpm+5; % D27
pinholelist =[d01 id07 d17 id25 d27]; % this order should be identical to the one in qemoptics.m
pinholename={'D01';'ID07';'D17';'ID25';'D27'};
% this order MUST be identical to the one in qemoptics.m and to
% ebs.pinholenames(1:5);, the LATTICE order starting frommjnection (cell
% 04)
id07=nbpm+1; % ID07
d17=nbpm+2; % D17
id25=nbpm+3; % ID25
d27=nbpm+4; % D27
d01=nbpm+5; % D01 pinhole
pinholelist =[id07 d17 id25 d27 d01] ; % this order should be identical to the one in qemoptics.m
pinholename={'ID07';'D17';'ID25';'D27';'D01'};
emittances=qemb.emittances;
sbpm=cat(1,qemb.lindata.SPos);
sskew=findspos(qemb.at(:),qemres.skewidx);
spinhole=[qemb.d01data.SPos; qemb.id07data.SPos; qemb.d17data.SPos; qemb.id25data.SPos; qemb.d27data.SPos];
spinhole=[qemb.id07data.SPos; qemb.d17data.SPos; qemb.id25data.SPos; qemb.d27data.SPos;qemb.d01data.SPos];
mess={...
sprintf('em. H [nm]: %7.3f %7.3f %7.3f',1.e9*mean(emittances(alllist,1:2:end)));...
sprintf('em. V [pm]: %7.3f %7.3f %7.3f',1.e12*mean(emittances(alllist,2:2:end)));...
sprintf('V. dispersion [m]: %g',qemb.pm.alpha*std(qemb.frespz,1));...
'pinhole V [pm]:';...
sprintf(' D01:%8.4f',1.e12*emittances( d01,6));...
sprintf('ID07:%8.4f',1.e12*emittances(id07,6));...
sprintf(' D17:%8.4f',1.e12*emittances( d17,6));...
sprintf('ID25:%8.4f',1.e12*emittances(id25,6));...
sprintf(' D27:%8.4f',1.e12*emittances( d27,6))};
sprintf(' D27:%8.4f',1.e12*emittances( d27,6));...
sprintf(' D01:%8.4f',1.e12*emittances( d01,6))};
figure(1); % emittances
plot(sbpm,1.e12*emittances(alllist,2:2:end));
......
......@@ -29,6 +29,9 @@ if (isfield(handles,'compare') && handles.compare) || ...
end
end
% PLOT EMITTANCE compared to measurement (see qemoptics.m and
% ebs.pinholenames(1:5)
mess0=semdisp(qemb,qemres,semres); % figures 1 and 2
mess=[mess;...
sprintf('tunes H/V: %.4f/%.4f',qemb.pm.fractunes);...
......
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