source: trunk/src/mode_sahelien/obsolete/time_serie_histog_phase1.m @ 42

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

parametrisation of composite_olr_phase....m; some unparametrized files in obsolete directory

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