From f6e662f4cf0d0397b297f3388dbf60fe396c0f41 Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Wed, 1 Jun 2022 10:31:09 +0200
Subject: [PATCH] scripts update

---
 matlab/plot/create_film.m                     |  2 +-
 .../plot_radial_transport_and_spacetime.m     | 10 ++++-----
 wk/analysis_3D.m                              | 22 +++++++++----------
 wk/header_3D_results.m                        | 17 ++++++++++++++
 4 files changed, 34 insertions(+), 17 deletions(-)
 create mode 100644 wk/header_3D_results.m

diff --git a/matlab/plot/create_film.m b/matlab/plot/create_film.m
index 4c7ee671..58b1baef 100644
--- a/matlab/plot/create_film.m
+++ b/matlab/plot/create_film.m
@@ -1,6 +1,6 @@
 function create_film(DATA,OPTIONS,format)
 %% Plot options
-FPS = 30; DELAY = 1/FPS;
+FPS = 16; DELAY = 1/FPS;
 BWR = 1; NORMALIZED = 1;
 if ~strcmp(OPTIONS.PLAN,'sx')
     T = DATA.Ts3D;
diff --git a/matlab/plot/plot_radial_transport_and_spacetime.m b/matlab/plot/plot_radial_transport_and_spacetime.m
index 0e81e20b..93e0c5cb 100644
--- a/matlab/plot/plot_radial_transport_and_spacetime.m
+++ b/matlab/plot/plot_radial_transport_and_spacetime.m
@@ -83,9 +83,9 @@ mvm = @(x) movmean(x,OPTIONS.NMVA);
     toplot = process_field(DATA,OPTIONS);
     f2plot = toplot.FIELD;
     
-    clim = max(max(max(abs(plt(f2plot(:,:,its3D:ite3D))))));
+    clim = max(max(max(abs(plt(f2plot(:,:,:))))));
     subplot(313)
-        [TY,TX] = meshgrid(DATA.x,DATA.Ts3D);
+        [TY,TX] = meshgrid(DATA.x,DATA.Ts3D(toplot.FRAMES));
         pclr = pcolor(TX,TY,squeeze(plt(f2plot))'); 
         set(pclr, 'edgecolor','none'); 
         legend(['$\langle ',OPTIONS.ST_FIELD,' \rangle_{y,z}$']) %colorbar;
@@ -103,14 +103,14 @@ mvm = @(x) movmean(x,OPTIONS.NMVA);
 %% Zonal vs NZonal energies    
     subplot(312)
     it0 = 1; itend = Ns3D;
-    trange = it0:itend;
+    trange = toplot.FRAMES;
     plt1 = @(x) x;%-x(1);
-    plt2 = @(x) x./max((x(its3D:ite3D)));
+    plt2 = @(x) x./max((x(:)));
     toplot = sum(squeeze(plt(f2plot)).^2,1); %ST from before
 %     plty = @(x) x(500:end)./max(squeeze(x(500:end)));
         yyaxis left
 %         plot(plt1(DATA.Ts3D(trange)),plt2(E_Zmode_SK(trange)),'DisplayName','$k_{zf}^2|\phi_{kzf}|^2$');
-        plot(plt1(DATA.Ts3D(trange)),plt2(toplot(trange)),'DisplayName','Sum $A^2$');
+        plot(plt1(DATA.Ts3D(trange)),plt2(toplot(:)),'DisplayName','Sum $A^2$');
         ylim([-0.1, 1.5]); ylabel('$E_{Z}$')
         yyaxis right
         plot(plt1(DATA.Ts3D(trange)),plt2(E_NZmode_SK(trange)),'DisplayName','$(1+k^2)|\phi^k|^2$');
diff --git a/wk/analysis_3D.m b/wk/analysis_3D.m
index 248577ed..249c138b 100644
--- a/wk/analysis_3D.m
+++ b/wk/analysis_3D.m
@@ -10,7 +10,7 @@ system(['mkdir -p ',MISCDIR]);
 CMD = ['rsync ', LOCALDIR,'outputs* ',MISCDIR]; disp(CMD);
 system(CMD);
 % Load outputs from jobnummin up to jobnummax
-JOBNUMMIN = 00; JOBNUMMAX = 08;
+JOBNUMMIN = 07; JOBNUMMAX = 20;
 data = compile_results(MISCDIR,JOBNUMMIN,JOBNUMMAX); %Compile the results from first output found to JOBNUMMAX if existing
 
 
@@ -21,7 +21,7 @@ FMT = '.fig';
 
 if 1
 %% Space time diagramm (fig 11 Ivanov 2020)
-options.TAVG_0   = 0.8*data.Ts3D(end); 
+options.TAVG_0   = 0.98*data.Ts3D(end); 
 options.TAVG_1   = data.Ts3D(end); % Averaging times duration
 options.NMVA     = 1;              % Moving average for time traces
 % options.ST_FIELD = '\Gamma_x';          % chose your field to plot in spacetime diag (e.g \phi,v_x,G_x)
@@ -40,7 +40,7 @@ end
 if 0
 %% MOVIES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % Options
-options.INTERP    = 0;
+options.INTERP    = 1;
 options.POLARPLOT = 0;
 options.NAME      = '\phi';
 % options.NAME      = 'N_i^{00}';
@@ -48,12 +48,12 @@ options.NAME      = '\phi';
 % options.NAME      = 'n_i^{NZ}';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'n_i';
-options.PLAN      = 'xy';
+options.PLAN      = 'xz';
 % options.NAME      = 'f_e';
 % options.PLAN      = 'sx';
 options.COMP      = 9;
 % options.TIME      = dat.Ts5D;
-options.TIME      = 920:1:1100;
+options.TIME      = 920:0.1:1170;
 data.EPS          = 0.1;
 data.a = data.EPS * 2000;
 create_film(data,options,'.gif')
@@ -62,12 +62,12 @@ end
 if 0
 %% 2D snapshots
 % Options
-options.INTERP    = 1;
+options.INTERP    = 0;
 options.POLARPLOT = 0;
 options.AXISEQUAL = 1;
-% options.NAME      = '\phi';
+options.NAME      = '\phi';
 % options.NAME      = 'n_i';
-options.NAME      = 'N_i^{00}';
+% options.NAME      = 'N_i^{00}';
 % options.NAME      = 'T_i';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'k^2n_e';
@@ -75,7 +75,7 @@ options.PLAN      = 'xz';
 % options.NAME      = 'f_i';
 % options.PLAN      = 'sx';
 options.COMP      = 9;
-options.TIME      = [900 1000 1100];
+options.TIME      = [1100 1150];
 data.a = data.EPS * 2e3;
 fig = photomaton(data,options);
 save_figure(data,fig)
@@ -113,12 +113,12 @@ end
 if 0
 %% Hermite-Laguerre spectrum
 % options.TIME = 'avg';
-options.P2J        = 0;
+options.P2J        = 1;
 options.ST         = 1;
 options.PLOT_TYPE  = 'space-time';
 options.NORMALIZED = 1;
 options.JOBNUM     = 0;
-options.TIME       = [900 950];
+options.TIME       = [1100 1150];
 options.specie     = 'i';
 options.compz      = 'avg';
 fig = show_moments_spectrum(data,options);
diff --git a/wk/header_3D_results.m b/wk/header_3D_results.m
new file mode 100644
index 00000000..05a07248
--- /dev/null
+++ b/wk/header_3D_results.m
@@ -0,0 +1,17 @@
+% Directory of the code "mypathtoHeLaZ/HeLaZ/"
+helazdir = '/home/ahoffman/HeLaZ/';
+% Directory of the simulation (from results)
+% if 1% Local results
+outfile ='';
+outfile ='';
+outfile ='';
+outfile ='shearless_cyclone/128x128x16xdmax_6_L_120_CBC_1.0';
+% outfile ='shearless_cyclone/128x128x16xdmax_L_120_CBC_1.0';
+% outfile ='shearless_cyclone/180x180x20x4x2_L_120_CBC_0.8_to_1.0';
+% outfile ='quick_run/CLOS_1_64x64_5x3_L_120_kN_2.0_kT_0.5_nu_1e-01_SGGK';
+% outfile ='pedestal/64x64x16x2x1_L_300_LnT_20_nu_0.1';
+% outfile ='quick_run/32x32x16_5x3_L_300_q0_2.5_e_0.18_kN_20_kT_20_nu_1e-01_DGGK';
+% outfile ='shearless_cyclone/128x128x16x8x4_L_120_CTC_1.0/';
+% outfile ='shearless_cyclone/180x180x20x4x2_L_120_CBC_0.8_to_1.0/';
+% outfile ='pedestal/128x128x16x4x2_L_120_LnT_40_nuDG_0.1';
+run analysis_HeLaZ
-- 
GitLab