Commit a7863271a8147a24fd773901b3b7fc76019b22e9

Authored by Jérémy Baudry
1 parent fdf7e180
Exists in master

nettoyage

Showing 1 changed file with 74 additions and 0 deletions   Show diff stats
output/data_treatment.m 0 → 100644
... ... @@ -0,0 +1,74 @@
  1 +clear all;
  2 +close all;
  3 +
  4 +
  5 +x=ncread('simulation1.nc','x_axis');
  6 +t=ncread('simulation1.nc','time');
  7 +om=ncread('simulation1.nc','omega');
  8 +spectre=ncread('simulation1.nc','Spectrum');
  9 +Dave=ncread('simulation1.nc','Dave');
  10 +Dmax=ncread('simulation1.nc','Dmax');
  11 +
  12 +
  13 +f=om/(2*pi);
  14 +E=reshape(spectre(end,end,:),length(om),1);
  15 +Ei=reshape(spectre(30,:,:),length(x),length(om));
  16 +E1=reshape(spectre(1,1,:),length(om),1);
  17 +
  18 +
  19 +
  20 +
  21 +
  22 +figure(1)
  23 +cmap=rand(length(t),3);
  24 + w = waitforbuttonpress;
  25 +for i=1:length(t)
  26 +
  27 + figure(1)
  28 +
  29 + sp=reshape(spectre(i,:,:),length(x),length(om));
  30 + h=mesh(f,x,sp);
  31 + axis([min(f) max(f) min(x) max(x) 0 max(E1)])
  32 + xlabel('Frequency [s^{-1}]')
  33 + zlabel('Energy')
  34 +
  35 + ylabel('x [km]')
  36 + pause(0.1)
  37 +
  38 +end
  39 +
  40 +for i=1:length(om)
  41 + EE(i)=sum(Ei(:,i));
  42 +
  43 +end
  44 +figure
  45 +plot(E1)
  46 +hold on
  47 +plot(EE,'r')
  48 +
  49 +for i=1:length(t)
  50 +
  51 +E2=reshape(spectre(i,:,:),length(x),length(om));
  52 +m0(i)=sum(sum(E2))/sum(E1);
  53 +end
  54 +figure
  55 +plot(t,m0)
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +figure
  63 +
  64 +
  65 +
  66 + plot(x,Dmax,'color','r')
  67 + hold on
  68 + plot(x,Dave,'--b')
  69 + grid on
  70 +
  71 + xlabel('x [km]')
  72 + ylabel('Floe size [m]')
  73 +
  74 + legend('Dmax','<D>')
0 75 \ No newline at end of file
... ...