From 48b18bf4b80719fddf60c7b342c173c9f56ca8ad Mon Sep 17 00:00:00 2001 From: Jean-Denis Vauguet Date: Mon, 1 Jun 2009 03:34:17 +0200 Subject: [PATCH] plop --- .../MATLAB/vectorial/data_processing.m | 9 ++--- .../IPGP Saint Maur/MATLAB/vectorial/modesT_vect.m | 20 +++++----- .../IPGP Saint Maur/MATLAB/vectorial/wind_effect.m | 45 +++++++++++++++++----- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/data_processing.m b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/data_processing.m index dfcc379..849bad0 100644 --- a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/data_processing.m +++ b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/data_processing.m @@ -36,15 +36,15 @@ if optargin > 0 end if ~isempty(varargin{2}) - binf = varargin{2} + binf = varargin{2}; end if ~isempty(varargin{3}) - res = varargin{3} + res = varargin{3}; end if ~isempty(varargin{4}) - bsup = varargin{4} + bsup = varargin{4}; end else % on demand… @@ -54,9 +54,6 @@ else end end -disp '---' -size(w) -disp '---' w = w(binf:res:bsup); u = u(binf:res:bsup); p = p(binf:res:bsup); diff --git a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/modesT_vect.m b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/modesT_vect.m index 8b4e499..dd3e305 100644 --- a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/modesT_vect.m +++ b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/modesT_vect.m @@ -122,7 +122,7 @@ if do_auto_L kx = wn./c; ky = kx; L = round(1/kx.*1e-3) - pause + %pause else % essentiellement pour les tests à vent nul %L = [10 15 20 25 50 100 150 200 250 300 350 400]*1.e3; @@ -161,15 +161,15 @@ load BestView2 % petits contrôles… -pause -disp '+++' -binf -res -bsup -T -L -disp '+++' -pause +%pause +%disp '+++' +%binf +%res +%bsup +%T +%L +%disp '+++' +%pause %---------------------------------- diff --git a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/wind_effect.m b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/wind_effect.m index fccce9a..d15980a 100644 --- a/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/wind_effect.m +++ b/docs/fac/stage/IPGP Saint Maur/MATLAB/vectorial/wind_effect.m @@ -81,10 +81,10 @@ data = []; for j = 1:length(L) for k = 1:length(T) name = [prefix 'data_wind' num2str(u0b) 'to' num2str(u0t) '_L' num2str(L(j)) '_period' num2str(T(k)) '.txt']; - data(:,:,j,k) = data_processing(name, 'real', binf, 1, bsup) + data(:,:,j,k) = data_processing(name, 'real', binf, 1, bsup); % TODO FIXME là le modesT_vect a fait nawak, du 10e80 sur w, doit y avoir une connerie avec les arguments ! % donc, les faire s'afficher, avec des pauses, ainsi que K etc. - pause + %pause end end @@ -111,25 +111,49 @@ end % data(:,:,2,2) = [-1 -2; -3 -4; -5 -6] amp_max_builder = []; +amp_ref_builder = []; amp_max = []; -amp_tmp = squeeze(data(:,1,:,:)) % on récupère w max pour tous les L et T +amp_ref = []; +amp_tmp = squeeze(data(:,1,:,:)); % on récupère w max pour tous les L et T +amp_tmp2 = squeeze(wind_ref(:,1,:,:)); % attention, ça lit d'abord les j, puis les k : (1,1), (2,1), (1,2), (2,2) test = squeeze(min(amp_tmp)+max(amp_tmp)) < 0; % look for the sign +test2 = squeeze(min(amp_tmp2)+max(amp_tmp2)) < 0; % then process each w record for j = 1:size(test,1) for k = 1:size(test,2) if test(j,k) == 1 - amp_max_builder = [amp_max_builder min(amp_tmp(:,k,j))] + amp_max_builder = [amp_max_builder min(amp_tmp(:,k,j))]; + else + size(amp_tmp) + size(amp_tmp2) + size(test) + size(test2) + j + k + pause + % TODO FIXME il faut séparer les boucles et les indices j k pour la ref et les data ? + % a priori c'est pas utile, ils font nécessairement la même taille + % par contre, k débute à 3, chelou, et erreur index/size derrière + + amp_max_builder = [amp_max_builder max(amp_tmp(:,k,j))]; + end + + if test2(j,k) == 1 + amp_ref_builder = [amp_ref_builder min(amp_tmp2(:,k,j))]; else - amp_max_builder = [amp_max_builder max(amp_tmp(:,k,j))] + amp_ref_builder = [amp_ref_builder max(amp_tmp2(:,k,j))]; end end - amp_max = [amp_max; amp_max_builder] + amp_max = [amp_max; amp_max_builder]; + amp_ref = [amp_ref; amp_ref_builder]; amp_max_builder = []; + amp_ref_builder = []; end disp '---' -amp_max = amp_max' % L in columns (one max per line for a given T), T in rows (one max per column for a given L) +amp_max = amp_max'; % L in columns (one max per line for a given T), T in rows (one max per column for a given L) +amp_ref = amp_ref'; % le squeeze est cool car il donnera autant de colonnes que de T, autant de lignes que de L % ça permet de plotter direct versus L et T, pour un T ou un L donné respectivement ! @@ -138,11 +162,12 @@ amp_max = amp_max' % L in columns (one max per line for a given T), T in rows ( % FIXME pas vraiment sûr que ça fonctionne, les valeurs de amp_max sont cheloues % tout vérifier pas à pas, ie. quelles valeurs ça manipule par rapport aux fichiers .txt % (faire des load manuels et vérifier les amplitudes max etc.) -hold on; figure(100); +hold on; disp 'plot pour T = ' -T(1) -plot(L, amp_max(:,1)); +T(2) +plot(L, amp_max(:,2), 'r'); +plot(L, amp_ref(:,2), '--b') %plot(T, amp_ref, '--b'); %title('maximum w amplitude for each period'); hold off; -- 2.11.4.GIT