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