Commit 61bfa570 authored by Simone Liuzzo's avatar Simone Liuzzo

dipole errors display as in sempanel

parent 70b4391c
function [dkk,stdf,meanf]=qcheck(k,k0,ax,largefig)
function [dkk,stdf,meanf]=qcheck(k,k0,dang_ang,ax,largefig)
%QCHECK Analyzes quadrupole strength errors
%
%DKK=QCHECK(KL,KL0)
......@@ -6,6 +6,7 @@ function [dkk,stdf,meanf]=qcheck(k,k0,ax,largefig)
[nq,nm]=size(k);
nfamq=nq;
nfamd=length(dang_ang);
labels=ebs.qpname(1:17);
k0l=k0(:,ones(1,nm));
......@@ -13,25 +14,41 @@ dkk=(k-k0l)./k0l;
if largefig
figure; extfigax = gca;
figure;
subplot(2,1,1);
extfigax = gca;
bar(extfigax,[dkk]);
%title(ax,'Gradient errors');
ylabel(extfigax,'\DeltaK/K');
grid(extfigax,'on');
set(extfigax,'Xlim',[0 nfamq+1],'FontSize',6);
set(extfigax,'Xlim',[0 nfamq+1],'FontSize',12);
subplot(2,1,2);
extfigax = gca;
bar(extfigax,[dang_ang]);
%title(ax,'Gradient errors');
ylabel(extfigax,'\Delta\Theta/\Theta');
grid(extfigax,'on');
set(extfigax,'Xlim',[0 nfamd+1],'FontSize',12);
end
Nc = length(dkk);
extracor = mod(Nc,32);
cor_per_cell_mean = squeeze(mean(reshape(dkk((1+extracor/2):(Nc-extracor/2)),32,[]),2));
cor_per_cell_std = squeeze(std(reshape(dkk((1+extracor/2):(Nc-extracor/2)),32,[]),1,2));
bar(ax,[cor_per_cell_mean,cor_per_cell_std],'EdgeColor','none');
cor_per_cell_quad = squeeze(std(reshape(dkk((1+extracor/2):(Nc-extracor/2)),32,[]),1,2));
bar(ax,[cor_per_cell_quad],'EdgeColor','none');
ylabel(ax,'\DeltaK/K');
legend(ax,'mean','std');
grid(ax,'on');
set(ax,'Xlim',[0 32],'FontSize',6);
set(ax,'Xlim',[0 32+1],'FontSize',6);
Nc = length(dang_ang);
extracor = mod(Nc,32);
cor_per_cell_dip = squeeze(std(reshape(dang_ang((1+extracor/2):(Nc-extracor/2)),32,[]),1,2));
yyaxis(ax,'right');
bar(ax,[cor_per_cell_dip],'EdgeColor','none');
ylabel(ax,'\Delta\Theta/\Theta');
grid(ax,'on');
set(ax,'Xlim',[0 32+1],'FontSize',6);
......
......@@ -3,9 +3,9 @@ tic
if nargin < 5, handles=struct(); end
if isfield(handles,'axes1')
qcheck(qemb.kn,qemb0.kn,handles.axes1,get(handles.largefigures,'Value'));
qcheck(qemb.kn,qemb0.kn,qemb.dipdelta,handles.axes1,get(handles.largefigures,'Value'));
else
qcheck(qemb.kn,qemb0.kn,[],get(handles.largefigures,'Value'));
qcheck(qemb.kn,qemb0.kn,qemb.dipdelta,[],get(handles.largefigures,'Value'));
end
toc;
qemb.at=qemat(qemres,qemb,true); % builds the at structure
......
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