From ebf7a53b7a5c5ff2b77144821e650c6cc016fc24 Mon Sep 17 00:00:00 2001 From: Antoine <antoine.hoffmann@epfl.ch> Date: Tue, 14 May 2024 11:44:01 +0200 Subject: [PATCH] update matlab scripts --- matlab/compile_results.m | 18 +++++++++--------- matlab/plot/photomaton.m | 6 +----- matlab/process_field.m | 24 +++--------------------- 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/matlab/compile_results.m b/matlab/compile_results.m index dcecd1e..b8fe95e 100644 --- a/matlab/compile_results.m +++ b/matlab/compile_results.m @@ -63,15 +63,15 @@ while(CONTINUE) % CPUTIME = h5readatt(filename,'/data/input','cpu_time'); % DT_SIM = h5readatt(filename,'/data/input','dt'); [P, J, kx, ky, z] = load_grid_data(filename); - W_GAMMA = strcmp(h5readatt(filename,'/data/input','write_gamma'),'y'); - W_HF = strcmp(h5readatt(filename,'/data/input','write_hf' ),'y'); - W_PHI = strcmp(h5readatt(filename,'/data/input','write_phi' ),'y'); - W_NA00 = strcmp(h5readatt(filename,'/data/input','write_Na00' ),'y'); - W_NAPJ = strcmp(h5readatt(filename,'/data/input','write_Napj' ),'y'); - W_SAPJ = strcmp(h5readatt(filename,'/data/input','write_Sapj' ),'y'); - W_DENS = strcmp(h5readatt(filename,'/data/input','write_dens' ),'y'); - W_TEMP = strcmp(h5readatt(filename,'/data/input','write_temp' ),'y'); - KIN_E = strcmp(h5readatt(filename,'/data/input', 'KIN_E' ),'y'); + W_GAMMA = strcmp(h5readatt(filename,'/data/input/diagnostics','write_gamma'),'y'); + W_HF = strcmp(h5readatt(filename,'/data/input/diagnostics','write_hf' ),'y'); + W_PHI = strcmp(h5readatt(filename,'/data/input/diagnostics','write_phi' ),'y'); + W_NA00 = strcmp(h5readatt(filename,'/data/input/diagnostics','write_Na00' ),'y'); + W_NAPJ = strcmp(h5readatt(filename,'/data/input/diagnostics','write_Napj' ),'y'); + W_SAPJ = strcmp(h5readatt(filename,'/data/input/diagnostics','write_Sapj' ),'y'); + W_DENS = strcmp(h5readatt(filename,'/data/input/diagnostics','write_dens' ),'y'); + W_TEMP = strcmp(h5readatt(filename,'/data/input/diagnostics','write_temp' ),'y'); + KIN_E = strcmp(h5readatt(filename,'/data/input/model', 'ADIAB_E' ),'n'); try BETA = h5readatt(filename,'/data/input','beta'); catch diff --git a/matlab/plot/photomaton.m b/matlab/plot/photomaton.m index d563030..2bb013e 100644 --- a/matlab/plot/photomaton.m +++ b/matlab/plot/photomaton.m @@ -75,17 +75,13 @@ FIGURE.fig = figure; %set(gcf, 'Position', toplot.DIMENSIONS.*[1 1 Ncols Nrows] tshot = DATA.Ts5D(FRAMES(i_)); end xlabel(toplot.XNAME); ylabel(toplot.YNAME); -% if i_ > 1; set(gca,'ytick',[]); end; title([sprintf('$t c_s/R=%5.2f$',tshot),', max = ',sprintf('%.1e',frame_max)]); - if OPTIONS.CLIMAUTO - clim('auto') - end end if OPTIONS.AXISEQUAL pbaspect(toplot.ASPECT) end if ~strcmp(OPTIONS.PLAN,'kxky') - clim([-1,1]*frame_max/scale); + % clim([-1,1]*frame_max/scale); colormap(bluewhitered); if OPTIONS.INTERP shading interp; diff --git a/matlab/process_field.m b/matlab/process_field.m index 6e9b664..70763eb 100644 --- a/matlab/process_field.m +++ b/matlab/process_field.m @@ -52,25 +52,8 @@ Lmin_ = min([Xmax_,Ymax_]); Rx = Xmax_/Lmin_ * SCALE + (1-SCALE)*1.2; Ry = Ymax_/Lmin_ * SCALE + (1-SCALE)*1.2; ASPECT = [Rx, Ry, 1]; -DIMENSIONS = [500, 1000, OPTIONS.RESOLUTION*Rx, OPTIONS.RESOLUTION*Ry]; -% Polar grid -POLARNAME = []; -if POLARPLOT - POLARNAME = 'polar'; - X__ = (X+DATA.a).*cos(Y); - Y__ = (X+DATA.a).*sin(Y); - X = X__; - Y = Y__; - XNAME='X'; - YNAME='Z'; - DIMENSIONS = [100, 100, OPTIONS.RESOLUTION, OPTIONS.RESOLUTION]; - ASPECT = [1,1,1]; - sz = size(X); - FIELD = zeros(sz(1),sz(2),Nt); -else - sz = size(X); - FIELD = zeros(sz(1),sz(2),Nt); -end +sz = size(X); +FIELD = zeros(sz(1),sz(2),Nt); %% Process the field to plot % -- switch OPTIONS.COMP @@ -346,8 +329,7 @@ TOPLOT.Z = Z; TOPLOT.FIELDNAME = FIELDNAME; TOPLOT.XNAME = XNAME; TOPLOT.YNAME = YNAME; -TOPLOT.FILENAME = [NAME,'_',OPTIONS.PLAN,'_',COMPNAME,'_',POLARNAME]; -TOPLOT.DIMENSIONS= DIMENSIONS; +TOPLOT.FILENAME = [NAME,'_',OPTIONS.PLAN,'_',COMPNAME]; TOPLOT.ASPECT = ASPECT; TOPLOT.FRAMES = FRAMES; TOPLOT.INTERP = INTERP; -- GitLab