Skip to content
Snippets Groups Projects
Commit 529ed041 authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann
Browse files

scripts update

parent 9df7bc48
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,10 @@ x = options.XPERP;
smin = min(abs(s));
xmin = min(abs(x));
[~, ikx0] = min(abs(data.kx));
[~, iky0] = min(abs(data.ky));
kx_ = data.kx; ky_ = data.ky;
switch options.SPECIE
case 'e'
Napj_ = data.Nepj;
......@@ -23,13 +27,16 @@ switch options.SPECIE
parray = double(data.Pi);
jarray = double(data.Ji);
end
Np = numel(parray); Nj = numel(jarray);
switch options.Z
case 'avg'
Napj_ = mean(Napj_,5);
phi_ = mean(data.PHI,3);
otherwise
[~,iz] = min(abs(options.Z-data.z));
Napj_ = Napj_(:,:,:,:,iz,:);
phi_ = data.PHI(:,:,iz);
end
Napj_ = squeeze(Napj_);
......@@ -42,49 +49,89 @@ Napj_ = mean(Napj_(:,:,:,:,frames),5);
Napj_ = squeeze(Napj_);
if options.non_adiab
for ij_ = 1:Nj
for ikx = 1:data.Nkx
for iky = 1:data.Nky
kp_ = sqrt(kx_(ikx)^2 + ky_(iky)^2);
Napj_(1,ij_,ikx,iky) = Napj_(1,ij_,ikx,iky) + kernel(ij_,kp_)*phi_(ikx,iky);
end
end
end
end
Np = numel(parray); Nj = numel(jarray);
% x = 0
Fs = zeros(data.Nkx,data.Nky,numel(s));
FAM = FaM(s,xmin);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,s);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,xmin);
HLF = HH.*LL.*FAM;
for ikx = 1:data.Nkx
for iky = 1:data.Nky
Fs(ikx,iky,:) = squeeze(Fs(ikx,iky,:))' + Napj_(ip_,ij_,ikx,iky)*HLF;
if options.RMS
Fs = zeros(data.Nkx,data.Nky,numel(s));
FAM = FaM(s,xmin);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,s);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,xmin);
HLF = HH.*LL.*FAM;
for ikx = 1:data.Nkx
for iky = 1:data.Nky
Fs(ikx,iky,:) = squeeze(Fs(ikx,iky,:))' + Napj_(ip_,ij_,ikx,iky)*HLF;
end
end
end
end
else
Fs = s*0;
FAM = FaM(s,xmin);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,s);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,xmin);
Fs = Fs + squeeze(Napj_(ip_,ij_,ikx0,iky0))*HH.*LL.*FAM;
end
end
end
% s = 0
Fx = zeros(data.Nkx,data.Nky,numel(x));
FAM = FaM(smin,x);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,smin);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,x);
HLF = HH.*LL.*FAM;
for ikx = 1:data.Nkx
for iky = 1:data.Nky
Fx(ikx,iky,:) = squeeze(Fx(ikx,iky,:))' + Napj_(ip_,ij_,ikx,iky)*HLF;
if options.RMS
Fx = zeros(data.Nkx,data.Nky,numel(x));
FAM = FaM(x,smin);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,smin);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,x);
HLF = HH.*LL.*FAM;
for ikx = 1:data.Nkx
for iky = 1:data.Nky
Fx(ikx,iky,:) = squeeze(Fx(ikx,iky,:))' + Napj_(ip_,ij_,ikx,iky)*HLF;
end
end
end
end
else
Fx = x*0;
FAM = FaM(smin,x);
for ip_ = 1:Np
p_ = parray(ip_);
HH = Hp(p_,smin);
for ij_ = 1:Nj
j_ = jarray(ij_);
LL = Lj(j_,x);
Fx = Fx + squeeze(Napj_(ip_,ij_,ikx0,iky0))*HH.*LL.*FAM;
end
end
end
Fs = real(Fs.*conj(Fs)); %|f_a|^2
Fs = sqrt(squeeze(sum(sum(Fs,1),2))); %sqrt(<|f_a|>kx,ky)
Fs = Fs./max(max(Fs));
Fx = real(Fx.*conj(Fx)); %|f_a|^2
Fx = sqrt(squeeze(sum(sum(Fx,1),2))); %sqrt(<|f_a|>kx,ky)
if options.RMS
Fs = squeeze(sqrt(mean(mean(Fs,1),2))); %sqrt(<|f_a|^2>kx,ky)
Fx = squeeze(sqrt(mean(mean(Fx,1),2))); %sqrt(<|f_a|^2>kx,ky)
end
Fs = Fs./max(max(Fs));
Fx = Fx./max(max(Fx));
end
\ No newline at end of file
function [ FIGURE ] = plot_fa( DATA, OPTIONS )
FIGURE.fig = figure; FIGURE.FIGNAME = ['f_a_',DATA.PARAMS];
switch OPTIONS.Z
case 'avg'
zcomp = ' z-avg';
otherwise
zcomp = [' z=',sprintf('%2.2f',DATA.z(OPTIONS.Z))];
end
if OPTIONS.ONED
OPTIONS.SPECIE = 'i';
[~,~,fsi,fxi] = compute_fa_1D(DATA, OPTIONS);
OPTIONS.SPECIE = 'e';
[s,x,fse,fxe] = compute_fa_1D(DATA, OPTIONS);
[s,x,fsa,fxa] = compute_fa_1D(DATA, OPTIONS);
[~,it] = min(abs(OPTIONS.T-DATA.Ts5D));
subplot(1,2,1)
plot(s,fse); hold on
plot(s,fsi);
legend('e','i')
plot(s,fsa); hold on
legend(OPTIONS.SPECIE)
xlabel('$v_\parallel, (\mu=0)$'); ylabel('$\langle |f_a|^2\rangle_{xy}^{1/2}$');
title(DATA.param_title);
subplot(1,2,2)
plot(x,fxe); hold on;
plot(x,fxi);
legend('e','i')
plot(x,fxa); hold on;
legend(OPTIONS.SPECIE)
xlabel('$\mu, (v_\parallel=0)$'); ylabel('$\langle |f_a|^2\rangle_{xy}^{1/2}$');
if numel(it) == 1
title(['t=',num2str(DATA.Ts5D(it))]);
......@@ -26,33 +26,24 @@ if OPTIONS.ONED
end
else
OPTIONS.SPECIE = 'i';
[~,~,FFi] = compute_fa_2D(DATA, OPTIONS);
OPTIONS.SPECIE = 'e';
[SS,XX,FFe] = compute_fa_2D(DATA, OPTIONS);
[SS,XX,FFa] = compute_fa_2D(DATA, OPTIONS);
[~,it] = min(abs(OPTIONS.T-DATA.Ts5D));
subplot(1,2,1)
if OPTIONS.CTR
contour(SS,XX,FFi',128);
else
pclr = pcolor(SS,XX,FFi'); set(pclr, 'edgecolor','none'); shading interp
switch OPTIONS.PLT_FCT
case 'contour'
contour(SS,XX,FFa',128);
case 'pcolor'
pclr = pcolor(SS,XX,FFa'); set(pclr, 'edgecolor','none'); shading interp
end
xlabel('$v_\parallel$'); ylabel('$\mu$');
legend('$\langle |f_i|^2\rangle_{xy}^{1/2}$')
title(DATA.param_title);
% FF = log10(FF);
subplot(1,2,2)
if OPTIONS.CTR
contour(SS,XX,FFe',128);
else
pclr = pcolor(SS,XX,FFe'); set(pclr, 'edgecolor','none'); shading interp
end
legend('$\langle |f_e|^2\rangle_{xy}^{1/2}$')
xlabel('$v_\parallel$'); ylabel('$\mu$');
legend(['$\langle |f_',OPTIONS.SPECIE,'|^2\rangle_{xy}^{1/2}$',zcomp])
if numel(it) == 1
title(['t=',num2str(DATA.Ts5D(it))]);
title(['HeLaZ''$\langle |f_',OPTIONS.SPECIE...
,'|^2\rangle_{xy}^{1/2}$',zcomp...
,', $t=$[',sprintf('%1.1f',DATA.Ts5D(it)),']']);
else
title(['average $t\in$[',num2str(DATA.Ts5D(min(it))),',',num2str(DATA.Ts5D(max(it))),']']);
title(['HeLaZ''$\langle |f_',OPTIONS.SPECIE,...
'|^2\rangle_{xy}^{1/2}$',zcomp,...
', average $t\in$[',sprintf('%1.1f',DATA.Ts5D(min(it))),',',sprintf('%1.1f',DATA.Ts5D(max(it))),']']);
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment