[10] | 1 | clear;
|
---|
| 2 | load phase8.txt;
|
---|
| 3 | phase8=reshape(phase8,122,28,3);
|
---|
| 4 |
|
---|
| 5 | %%%%%%%%%%%% FICHIER TYPE DE TEMPS
|
---|
| 6 | % on ouvre le fichier
|
---|
| 7 | load occu.txt
|
---|
| 8 |
|
---|
| 9 | % on reorganise le fichier de type de temps (jours,annees,cluster)
|
---|
| 10 | y=reshape(occu,122,58,4);
|
---|
| 11 | clear occu;
|
---|
| 12 |
|
---|
| 13 | % on selectionne les annees de 1979 a 2006
|
---|
| 14 | occu_type_tps(:,:,:)=y(:,30:57,:); clear y;
|
---|
| 15 |
|
---|
| 16 | % intialisation des tableaux
|
---|
| 17 | type_temps_compomax=zeros(80,21,4);
|
---|
| 18 | compteurmax=0;
|
---|
| 19 |
|
---|
| 20 | for a=1:28; % boucle sur les annees
|
---|
| 21 | for b=1:122;
|
---|
[15] | 22 | if (b>11 && b<112); % 1ere condition (laisser une marge de 10)
|
---|
[10] | 23 | % condition 1 on est a un maximum deltas apres sont negetifs et
|
---|
| 24 | % delta avant postifs
|
---|
| 25 | if phase8(b,a,1)==1;
|
---|
| 26 | compteurmax=compteurmax+1;
|
---|
| 27 | type_temps_compomax(compteurmax,1,:)=occu_type_tps(b-10,a,:);
|
---|
| 28 | type_temps_compomax(compteurmax,2,:)=occu_type_tps(b-9,a,:);
|
---|
| 29 | type_temps_compomax(compteurmax,3,:)=occu_type_tps(b-8,a,:);
|
---|
| 30 | type_temps_compomax(compteurmax,4,:)=occu_type_tps(b-7,a,:);
|
---|
| 31 | type_temps_compomax(compteurmax,5,:)=occu_type_tps(b-6,a,:);
|
---|
| 32 | type_temps_compomax(compteurmax,6,:)=occu_type_tps(b-5,a,:);
|
---|
| 33 | type_temps_compomax(compteurmax,7,:)=occu_type_tps(b-4,a,:);
|
---|
| 34 | type_temps_compomax(compteurmax,8,:)=occu_type_tps(b-3,a,:);
|
---|
| 35 | type_temps_compomax(compteurmax,9,:)=occu_type_tps(b-2,a,:);
|
---|
| 36 | type_temps_compomax(compteurmax,10,:)=occu_type_tps(b-1,a,:);
|
---|
| 37 | type_temps_compomax(compteurmax,11,:)=occu_type_tps(b,a,:);
|
---|
| 38 | type_temps_compomax(compteurmax,12,:)=occu_type_tps(b+1,a,:);
|
---|
| 39 | type_temps_compomax(compteurmax,13,:)=occu_type_tps(b+2,a,:);
|
---|
| 40 | type_temps_compomax(compteurmax,14,:)=occu_type_tps(b+3,a,:);
|
---|
| 41 | type_temps_compomax(compteurmax,15,:)=occu_type_tps(b+4,a,:);
|
---|
| 42 | type_temps_compomax(compteurmax,16,:)=occu_type_tps(b+5,a,:);
|
---|
| 43 | type_temps_compomax(compteurmax,17,:)=occu_type_tps(b+6,a,:);
|
---|
| 44 | type_temps_compomax(compteurmax,18,:)=occu_type_tps(b+7,a,:);
|
---|
| 45 | type_temps_compomax(compteurmax,19,:)=occu_type_tps(b+8,a,:);
|
---|
| 46 | type_temps_compomax(compteurmax,20,:)=occu_type_tps(b+9,a,:);
|
---|
| 47 | type_temps_compomax(compteurmax,21,:)=occu_type_tps(b+10,a,:);
|
---|
| 48 | end;
|
---|
| 49 | end;
|
---|
| 50 | end;
|
---|
| 51 | end;
|
---|
| 52 |
|
---|
| 53 | % on ne selectionne que la partie du tableau ou il y a des valeurs
|
---|
| 54 | type_temps_compomax=type_temps_compomax(1:compteurmax,:,:);
|
---|
| 55 |
|
---|
| 56 | type_temps_moy=reshape(occu_type_tps,3416,4);
|
---|
[15] | 57 | disp(['iii : compteurmax =', int2str(compteurmax)]);
|
---|
[10] | 58 | % on fait la somme des types de temps sur toute la periode de temps
|
---|
| 59 | % on obtent un tableau de la forme (jours-avant-apres,cluster)
|
---|
| 60 |
|
---|
| 61 | type_temps_compomax1(:,:)=sum(type_temps_compomax);
|
---|
| 62 | type_temps_moy=sum(type_temps_moy);
|
---|
| 63 |
|
---|
| 64 | clear type_temps_compomax;
|
---|
| 65 |
|
---|
| 66 | % on fait la somme => le nbre de jour avec 1 type de temps persistant
|
---|
| 67 | % pour chaque jour
|
---|
| 68 | sum_kara_max=sum((type_temps_compomax1)'); %' transpose => tableau (cluster,jour)
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | % on traduit le nbre d occurence en frequences relatives
|
---|
[15] | 72 | kara_max=zeros(21,4);
|
---|
| 73 | kara_moy=zeros(21,4);
|
---|
[10] | 74 | for a=1:21;
|
---|
| 75 | for b=1:4;
|
---|
| 76 | kara_max(a,b)=type_temps_compomax1(a,b)/sum_kara_max(a);
|
---|
| 77 | kara_moy(b)=type_temps_moy(b)/3416;
|
---|
| 78 | end;
|
---|
| 79 | end;
|
---|
| 80 |
|
---|
| 81 | x=[-10:1:10]'; %'
|
---|
| 82 | kara_diff=zeros(21,4);
|
---|
| 83 | for a=1:21;
|
---|
| 84 | for b=1:4
|
---|
| 85 | kara_diff(a,b)=kara_max(a,b)-kara_moy(b);
|
---|
| 86 | end
|
---|
| 87 | end
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 | for a=1:4;
|
---|
| 91 | subplot(4,4,a+12);
|
---|
| 92 | diff=kara_diff(:,a)*100;
|
---|
| 93 | jour=[-10:10]';
|
---|
| 94 | if a==1;
|
---|
| 95 | bar(jour,diff,'r');
|
---|
| 96 | c=[1 0.55 0]; bar(jour,diff),colormap(c);
|
---|
| 97 | elseif a==2;
|
---|
| 98 | bar(jour,diff,'g');
|
---|
| 99 | elseif a==3;
|
---|
| 100 | bar(jour,diff,'b');
|
---|
| 101 | else
|
---|
| 102 | bar(jour,diff,'r');
|
---|
| 103 | end
|
---|
| 104 | set (gca,'XTick',[-10:2:10],'XTickLabel',[-10:2:10],'fontname','Arial','fontsize',6);
|
---|
| 105 | set (gca,'YTick',[-20:10:20],'YTickLabel',[-20:5:20],'fontname','Arial','fontsize',6);
|
---|
| 106 | axis([-10 10 -20 20]);
|
---|
[15] | 107 | set (gca,'tickDir','out');
|
---|
[10] | 108 | if a==1;
|
---|
| 109 | title('Atl low','Fontsize',8,'Fontname','Arial');
|
---|
| 110 | text(-20,0,'Phase8');
|
---|
| 111 | elseif a==2;
|
---|
| 112 | title('Atl Ridge','Fontsize',8,'Fontname','Arial');
|
---|
| 113 | elseif a==3;
|
---|
| 114 | title('NAO-','Fontsize',8,'Fontname','Arial');
|
---|
[15] | 115 | else
|
---|
[10] | 116 | title('Blocking','Fontsize',8,'Fontname','Arial');
|
---|
| 117 | end;
|
---|
| 118 | end
|
---|
| 119 |
|
---|
| 120 |
|
---|