Commit 00c5cf2e authored by Simone Liuzzo's avatar Simone Liuzzo
Browse files

added: rm measurement with E.Plouviez functions, interpretation of measurement...

added: rm measurement with E.Plouviez functions, interpretation of measurement functions by A.F., frequency response using respmat.py
parent 1aab4dc1
......@@ -147,7 +147,7 @@ qemb(2)=qempaneldisp(qemres,semres,qemb(2),qemb(1),handles);
if get(handles.ACRMcheckbox,'Value')
set(handles.statustext,'String','Loaded AC response data');
elseif get(handles.DCRMcheckbox,'Value')
set(handles.statustext,'String','Loaded DC response data');
set(handles.statustext,'String','Loaded DC response data');
end
% --- Executes on button press in pushbutton3: Fit Quads
......@@ -159,9 +159,9 @@ global qemb qemres semres
set(handles.statustext,'String','fitting quadrupoles');
if get(handles.AnalyticFitCheck,'Value') == 1
hw=waitbar(0,'Fitting quadrupole strengths (analytic)...');
hw=waitbar(0,'Fitting quadrupole strengths (analytic)...');
else
hw=waitbar(0,'Fitting quadrupole strengths...');
hw=waitbar(0,'Fitting quadrupole strengths...');
end
dispfunc=@(i,itot) waitbar(i/itot,hw);
okbpm=true(length(qemres.bpmidx),1);
......@@ -248,15 +248,52 @@ if get(handles.DCRMcheckbox,'Value') % DC/AC DC measurement
end
else % AC rm measurement
if get(handles.PartialRMcheckbox,'Value') % FULL/PARTIAL
set(handles.PartialRMcheckbox,'Value',0.0)
set(handles.FullRMcheckbox,'Value',1.0)
disp('Force Full for AC measurement')
end
set(handles.statustext,'String','AC RM measurement');
% ADD WARNING MESSAGE or question window to test FOFB is running.
answer = questdlg('Enable AC steerers. TEST FOFB (ON, then OFF). When ok press Yes','FOFB test');
if strcmp(answer,'Yes')
if get(handles.PartialRMcheckbox,'Value') % FULL/PARTIAL
set(handles.PartialRMcheckbox,'Value',0.0)
set(handles.FullRMcheckbox,'Value',1.0)
disp('Force Full for AC measurement')
end
set(handles.statustext,'String','AC RM measurement');
n=80000; % total excitation duration in 0.1 ms (10kHz samples)
% (about 80000 corresponds approx. to 8s total,
% excited in blocks of 4 steerers)
Xamp=8000; % amplitude of horizontal excitation (a.u.)
Zamp=1500; % amplitude of vertical excitation (a.u.)
% measure RM
[n_and_dateX] = StartMresStimX(n,Xamp);
[n_and_dateZ] = StartMresStimZ(n,Zamp);
% get data from Fast Data Archiver
[normI,phi,firstX,MresH,MresVH] = CalMresfdaH(n_and_dateX,Xamp); %#ok<ASGLU>
[normI,phi,firstZ,MresHV,MresV] = CalMresfdaV(n_and_dateZ,Zamp); %#ok<ASGLU>
responsematrixACfile = fullfile(qemres.datadir,'AC_RM_raw.mat');
save(responsematrixACfile,'MresH','MresVH','MresHV','MresV');
% same data is /users/diag/matlab/libera_data/TimeLabel/TimeLabelMres[XZ]**-XXX-****_**h**.mat
gainfile = 'Gain_new_180604'; % this file is in (local clone of matutil repository)/qem/ACORM
ReadFullRespMatData(qemres.datadir, responsematrixACfile,gainfile)
% use respmat.py to compute all other files
[status,out]=termappli('respmat.py -i -g 0 nop','response matrix',qemres.datadir);
set(handles.statustext,'String','Finished AC RM measurement');
else
set(handles.statustext,'String','AC steerers NOT OK. Measurement aborted.');
status = 1;
end
end
set(hObject,'Enable','On');
if status ~= 0, error('qem:noexec',out); end
......
Supports Markdown
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