source: trunk/src/mode_sahelien/time_serie_histog_phase8.m @ 15

Last change on this file since 15 was 15, checked in by pinsard, 16 years ago

modification according to mlint diagnostic

File size: 4.2 KB
Line 
1clear;
2load phase8.txt;
3phase8=reshape(phase8,122,28,3);
4
5%%%%%%%%%%%% FICHIER TYPE DE TEMPS
6% on ouvre le fichier
7load occu.txt
8
9% on reorganise le fichier de type de temps (jours,annees,cluster)
10y=reshape(occu,122,58,4);
11clear occu;
12
13% on selectionne les annees de 1979 a 2006
14occu_type_tps(:,:,:)=y(:,30:57,:); clear y;
15
16% intialisation des tableaux
17type_temps_compomax=zeros(80,21,4);
18compteurmax=0;
19
20for a=1:28; % boucle sur les annees
21   for b=1:122;
22      if (b>11 && b<112); % 1ere condition (laisser une marge de 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;         
51end;
52
53% on ne selectionne que la partie du tableau ou il y a des valeurs
54type_temps_compomax=type_temps_compomax(1:compteurmax,:,:);
55
56type_temps_moy=reshape(occu_type_tps,3416,4);
57disp(['iii : compteurmax =', int2str(compteurmax)]);
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
61type_temps_compomax1(:,:)=sum(type_temps_compomax);
62type_temps_moy=sum(type_temps_moy);
63
64clear type_temps_compomax;
65
66% on fait la somme => le nbre de jour avec 1 type de temps persistant
67% pour chaque jour
68sum_kara_max=sum((type_temps_compomax1)'); %' transpose => tableau (cluster,jour)
69
70
71% on traduit le nbre d occurence en frequences relatives
72kara_max=zeros(21,4);
73kara_moy=zeros(21,4);
74for 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;
79end;
80
81x=[-10:1:10]'; %'
82kara_diff=zeros(21,4);
83for a=1:21;
84    for b=1:4
85       kara_diff(a,b)=kara_max(a,b)-kara_moy(b);
86    end
87end
88
89
90for 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]);
107    set (gca,'tickDir','out');
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');
115       else
116       title('Blocking','Fontsize',8,'Fontname','Arial');
117    end;
118end
119
120
Note: See TracBrowser for help on using the repository browser.