Commit ec5d30ce authored by ncarmignani's avatar ncarmignani

added a function to get the total losses and modification of an objective...

added a function to get the total losses and modification of an objective function of rcds to use the new function
parent 86df1029
......@@ -69,7 +69,7 @@ end
% wait power supply
pause(2);
obj=getBLM(averagingtime);
obj=getTotalLosses(averagingtime);
%% save data to a global variable.
global g_data g_cnt
......
function [Losses, dLosses]=getTotalLosses(average)
% [Losses, dLosses]=getTotalLosses(average)
%
% get Beam Loss Monitor signal
% Losses is the average of 'average' acquisitions, dLosses is the standard
% deviation
% Each acquisition is 2 seconds times average
%
try
dev_BLM=tango.Device('srdiag/blm/all');
for ii=1:average
pause(2);
loss(ii)=dev_BLM.TotalLoss.read;
Losses=mean(loss);
dLosses=std(loss);
end
catch exc
char(exc)
getReport(exc,'extended');
error('could not access to TotalLoss attribute of srdiag/blm/all');
end
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