Commit 5f996a8d authored by Simone Liuzzo's avatar Simone Liuzzo

disabled correctors generate files. necessary for Full RM measurement

parent d7f9116c
......@@ -250,6 +250,8 @@ NBPM = length(o0(1,:));
%
% returns NOT normalized response.
disab = false;
% get individual device attribute
switch mode
case 'H'
......@@ -292,7 +294,7 @@ NBPM = length(o0(1,:));
% check if it is enabled
switch mode
case 'H'
en = obj.getEnabledHsteerers;
if en(hlist(actuatorindex))
disp(['Measuring ' hnames{actuatorindex} ...
......@@ -301,11 +303,12 @@ NBPM = length(o0(1,:));
warning([hnames{actuatorindex} ' is not enabled '...
'(either in orbit correction or itself). SKIPPED'])
response = zeros(size(o0));
return;
real_variation = 1;
disab = true;
end
case 'V'
en = obj.getEnabledVsteerers;
if en(vlist(actuatorindex))
disp(['Measuring ' vnames{actuatorindex} ...
......@@ -314,7 +317,8 @@ NBPM = length(o0(1,:));
warning([vnames{actuatorindex} ' is not enabled '...
'(either in orbit correction or itself). SKIPPED'])
response = NaN(size(o0));
return;
real_variation = 1;
disab = true;
end
case 'F'
......@@ -323,91 +327,93 @@ NBPM = length(o0(1,:));
end
% initial value of actuator
K0 = A.get;
DKp = zeros(size(K0)); % initialize array of real variation
DKm = zeros(size(K0));
if twoside % double sided measurement
% up
Kp=K0;
Kp(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) + 0.5*variation;
disp(['UP: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' + ' num2str(0.5*variation,'%3.2e') ...
' = ' num2str(Kp(hvlist(actuatorindex)),'%3.2e')]);
A.set(Kp); % moovable set also waits for setpoint reach.
if ~disab
% initial value of actuator
K0 = A.get;
DKp = zeros(size(K0)); % initialize array of real variation
DKm = zeros(size(K0));
% get real variation in case it could not reach set point
pause(additional_wait_time)
DKp = A.get - K0;
disp(['Asked variation of: ' num2str(0.5*variation) ...
' got ' num2str(DKp(hvlist(actuatorindex)))]);
op = measfun();
disp(['Dorbit: ' num2str(std2(op'-o0'))]);
disp(['+ orbit rms: ' num2str(std2(op([1,2],:)'))]);
% down
Km=K0;
Km(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) - 0.5*variation;
disp(['DOWN: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' - ' num2str(0.5*variation,'%3.2e') ...
' = ' num2str(Km(hvlist(actuatorindex)),'%3.2e')]);
A.set(Km);% moovable set also waits for setpoint reach.
% get real variation in case it could not reach set point
pause(additional_wait_time)
DKm = A.get - K0;
disp(['Asked variation of: ' num2str(-0.5*variation) ...
' got ' num2str(DKm(hvlist(actuatorindex)))]);
om = measfun();
disp(['Dorbit: ' num2str(std2(om'-o0'))]);
disp(['- orbit rms: ' num2str(std2(om([1,2],:)'))]);
else % single sided
Kp=K0;
Kp(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) + variation;
disp(['UP: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' + ' num2str(variation,'%3.2e') ...
' = ' num2str(Kp(hvlist(actuatorindex)),'%3.2e')]);
A.set(Kp);% moovable set also waits for setpoint reach.
if twoside % double sided measurement
% up
Kp=K0;
Kp(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) + 0.5*variation;
disp(['UP: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' + ' num2str(0.5*variation,'%3.2e') ...
' = ' num2str(Kp(hvlist(actuatorindex)),'%3.2e')]);
A.set(Kp); % moovable set also waits for setpoint reach.
% get real variation in case it could not reach set point
pause(additional_wait_time)
DKp = A.get - K0;
disp(['Asked variation of: ' num2str(0.5*variation) ...
' got ' num2str(DKp(hvlist(actuatorindex)))]);
op = measfun();
disp(['Dorbit: ' num2str(std2(op'-o0'))]);
disp(['+ orbit rms: ' num2str(std2(op([1,2],:)'))]);
% down
Km=K0;
Km(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) - 0.5*variation;
disp(['DOWN: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' - ' num2str(0.5*variation,'%3.2e') ...
' = ' num2str(Km(hvlist(actuatorindex)),'%3.2e')]);
A.set(Km);% moovable set also waits for setpoint reach.
% get real variation in case it could not reach set point
pause(additional_wait_time)
DKm = A.get - K0;
disp(['Asked variation of: ' num2str(-0.5*variation) ...
' got ' num2str(DKm(hvlist(actuatorindex)))]);
om = measfun();
disp(['Dorbit: ' num2str(std2(om'-o0'))]);
disp(['- orbit rms: ' num2str(std2(om([1,2],:)'))]);
else % single sided
Kp=K0;
Kp(hvlist(actuatorindex)) = K0(hvlist(actuatorindex)) + variation;
disp(['UP: ' num2str(K0(hvlist(actuatorindex)),'%3.2e') ...
' + ' num2str(variation,'%3.2e') ...
' = ' num2str(Kp(hvlist(actuatorindex)),'%3.2e')]);
A.set(Kp);% moovable set also waits for setpoint reach.
% get rea variation
pause(additional_wait_time)
DKp = A.get - K0;
disp(['Asked variation of: ' num2str(0.5*variation) ...
' got ' num2str(DKp(hvlist(actuatorindex)))]);
op = measfun();
disp(['Dorbit: ' num2str(std2(op'-o0'))]);
disp(['+ orbit rms: ' num2str(std2(op([1,2],:)'))]);
om = o0;
DKm = K0 - K0;
end
% get rea variation
% return to intial value
A.set(K0);
pause(additional_wait_time)
DKp = A.get - K0;
disp(['Asked variation of: ' num2str(0.5*variation) ...
' got ' num2str(DKp(hvlist(actuatorindex)))]);
op = measfun();
disp(['Dorbit: ' num2str(std2(op'-o0'))]);
disp(['+ orbit rms: ' num2str(std2(op([1,2],:)'))]);
% compute response (not normalized)
response = (op-om) ;
om = o0;
DKm = K0 - K0;
real_variation = DKp(hvlist(actuatorindex)) - DKm(hvlist(actuatorindex));
% check that orbit is back to its place.
driftcontrol; % this function returns an ERROR if orbit changed befor and after measurement
end
% return to intial value
A.set(K0);
pause(additional_wait_time)
% compute response (not normalized)
response = (op-om) ;
real_variation = DKp(hvlist(actuatorindex)) - DKm(hvlist(actuatorindex));
% check that orbit is back to its place.
driftcontrol; % this function returns an ERROR if orbit changed befor and after measurement
% get pinholes sizes variations
[ex,ey]=readpinholes(false); %#ok<ASGLU>
% save file
% save file also if disabled during measurement (all zeros are stored)
%matlab
save(fullfile(workingdirectory,filename),'response','variation','real_variation','mode','ex','ey','ex0','ey0');
% text
filenametotxt;
function filenametotxt
%text (same file names and format of respmat.py
switch mode
......@@ -501,8 +507,8 @@ bv(2).YDataSource ='stdv';
disp(['Measure Orbit RM for ' num2str(length(hlist)) ' / ' num2str(NHall) ' horizontal correctors']);
for ii = 1:length(hlist)
try
% measure
try
% measure
resp = measure('H',deltah,ii);
% assign in global RM
......
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