Commit d69d0e6e authored by Simone Liuzzo's avatar Simone Liuzzo

added fit history plot

parent 9405ecc9
function qemb=qempaneldisp(qemres,semres,qemb,qemb0,handles) %#ok<INUSL>
function [qemb,qemres]=qempaneldisp(qemres,semres,qemb,qemb0,handles) %#ok<INUSL>
tic
if nargin < 5, handles=struct(); end
......@@ -61,6 +61,13 @@ if all(isfield(qemres,{'resph','respv','frespx'}))
diff1=[diffh diffv];
residual=std2(diff1(:));
hdispresidual=qemb.pm.alpha*std2(qemres.bhscale*qemres.frespx-qemb.frespx);
if ~isempty(qemres.fithist) % store fit history
qemres.fithist=[qemres.fithist;[std2(diffh(:)),std2(diffv(:)),hdispresidual]];
else
qemres.fithist=[[std2(diffh(:)),std2(diffv(:)),hdispresidual]];
end
fprintf('residual H = %g m/rad\n', std2(diffh(:)));
fprintf('residual V = %g m/rad\n', std2(diffv(:)));
mess=[mess;' ';...
......@@ -74,6 +81,21 @@ if all(isfield(qemres,{'resph','respv','frespx'}))
end
% end
figure(61);
yyaxis left
hold off;
plot(qemres.fithist(:,1),'bx-','LineWidth',3,'MarkerSize',10);
hold on;
plot(qemres.fithist(:,2),'ro-','LineWidth',3,'MarkerSize',10);
xlabel('fit step #');
ylabel('std RM residual');
grid on;
yyaxis right
hold off;
plot(qemres.fithist(:,3),'gs-','LineWidth',3,'MarkerSize',10);
ylabel('Hor. disp. residual');
legend('HH','VV','DH');
disp('plot disp'); toc;
......@@ -95,7 +117,10 @@ if isfield(handles,'axes4') % displays corr. strengths
extracor = mod(Nc,32); % remove extra correctors from injection cells
cor_per_cell_std = squeeze(std(reshape(qemb.cor((1+extracor/2):(Nc-extracor/2),:),[],32,size(qemb.cor,2)),1,1));
% cor_per_cell_mean = squeeze(mean(reshape(qemb.cor((1+extracor/2):(Nc-extracor/2),:),32,[],2),2));
bar(handles.axes4,cor_per_cell_std,'EdgeColor','none');
wc= [0.9,0.5]; % superimpose ba
for ic = 1:size(cor_per_cell_std,2)
bar(handles.axes4,cor_per_cell_std(:,ic),wc(ic),'EdgeColor','none');
end
handles.axes4.XTick=[1:32];
handles.axes4.XTickLabel=arrayfun(@(a)num2str(a),[4:32,1:3],'un',0);
handles.axes4.XTickLabelRotation=90;
......
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