Commit 33a87535 authored by Simone Liuzzo's avatar Simone Liuzzo

display files and directory used

parent a90ca581
......@@ -24,10 +24,23 @@ qemres.bhscale=1;
qemres.datadir=dirname;
qemres.opticsdir=fullfile(dirname,'optics','');
[~,theodir]=system(['readlink ' fullfile(dirname,'optics','')]);
try
simu = tango.Device('sys/ringsimulator/ebs');
qemres.simufile=simu.get_property('RingFile');
catch
disp('tango ''sys/ringsimulator/ebs'' not available')
qemres.simufile ='None';
end
qemres.opticsname = theodir;
a=load(fullfile(qemres.opticsdir,'betamodel.mat'),'betamodel');
ring= a.betamodel;
warning('check SB are here')
%atmod=ebs.model(ring,'reduce',true); % removing splitted magnets not allowed, due to pinhole data!
atmod=ebs.model(ring,'reduce',true); % for number of DQ (96, not 131 splitted) for example
......@@ -154,12 +167,20 @@ bang=atmod.getfieldvalue(qemres.dipidx,'BendingAngle');
qemres.dipidx=qemres.dipidx(bang>0.00001);
%qemres.dipidx=qemres.dipidx(1);
warning('only quadrupoles, no DQ!')
qemres.qpidx= atmod.get(0,'qp')' ; %[atmod.get(0,'qp');atmod.get(0,'dq')];
qemres.dqidx=atmod.get(0,'dq')';
% AnalyticResponseMatrix.m must be modified to include DQ! also qemderiv*.m
% line 96 should be modified to get this working
qemres.qpidx= [atmod.get(0,'qp');atmod.get(0,'dq')]'; % fit locations
% qemres.qpidx= [atmod.get(0,'qp');]'; % fit locations
qemres.qcoridx=atmod.get(0,'qp')';
% % warning('only quadrupoles, no DQ!')
qemres.quadidx = atmod.get(0,'qp')' ; % only quadrupoles
% qemres.dqidx=atmod.get(0,'dq')';
qemres.dqidx=[atmod.get(0,'dq');]';
qemres.qcoridx=atmod.get(0,'qp')'; % either quadrupoles or DQ
qemres.qcorl=atgetfieldvalues(qemres.at(qemres.qcoridx),'Length');
%qemres.qpfit = ismember(qemres.qpidx,qemres.qcoridx);%keep all quads no DQ
......@@ -250,7 +271,7 @@ if nargout >= 3
end
Nq=textscan(fopen(fullfile(qemres.datadir,'quadcor.dat'),'r'),'%s %f','HeaderLines',7);
allqdq=sort([qemres.qpidx,qemres.dqidx([true,diff(qemres.dqidx)>2])]);
allqdq=sort(unique([qemres.quadidx,qemres.dqidx([true,diff(qemres.dqidx)>2])]));
[~,indq]=ismember(qemres.qcoridx,allqdq);% quad in quad dq list
corq = Nq{2}(indq); %select Quadrupoles
qemb(2).cor = corq;
......@@ -265,4 +286,12 @@ end
qemres=orderfields(qemres);
% display directories used
disp('RM directory:')
disp(qemres.datadir);
disp('reference optics directory:')
disp(qemres.opticsname);
disp('simulator optics file:')
disp(qemres.simufile);
end
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