1 | % |
---|
2 | |
---|
3 | clear; |
---|
4 | close all; |
---|
5 | |
---|
6 | status=load('eof3_1030.txt'); |
---|
7 | eof3_1030=status; |
---|
8 | clear status; |
---|
9 | status=load('eof2_1030.txt'); |
---|
10 | eof2_1030=status; |
---|
11 | clear status; |
---|
12 | |
---|
13 | eof3_moy=mean(eof3_1030); |
---|
14 | eof2_moy=mean(eof2_1030); |
---|
15 | |
---|
16 | eof3_std=std(eof3_1030); |
---|
17 | eof2_std=std(eof2_1030); |
---|
18 | eof3_1030=zeros(3416); |
---|
19 | eof2_1030=zeros(3416); |
---|
20 | for a=1:3416; |
---|
21 | eof3_1030(a)=(eof3_1030(a)-eof3_moy)/eof3_std; |
---|
22 | eof2_1030(a)=(eof2_1030(a)-eof2_moy)/eof2_std; |
---|
23 | end; |
---|
24 | |
---|
25 | correlations2=zeros(21,1); |
---|
26 | correlations3=zeros(21,1); |
---|
27 | |
---|
28 | for a=1:21; |
---|
29 | if a<12; |
---|
30 | fin=3416-(11-a); |
---|
31 | debut=(11-a)+1; |
---|
32 | x=eof2_1030(1:fin); |
---|
33 | y2=eof2_1030(debut:3416); |
---|
34 | y3=eof3_1030(debut:3416); |
---|
35 | else |
---|
36 | fin=3416-(a-11); |
---|
37 | debut=(a-11)+1; |
---|
38 | y2=eof2_1030(1:fin); |
---|
39 | y3=eof3_1030(1:fin); |
---|
40 | x=eof2_1030(debut:3416); |
---|
41 | end; |
---|
42 | clear vad; |
---|
43 | vad=corrcoef(x,y2); |
---|
44 | correlations2(a)=vad(2,1); |
---|
45 | clear vad; |
---|
46 | vad=corrcoef(x,y3); |
---|
47 | correlations3(a)=vad(2,1); |
---|
48 | end; |
---|
49 | jour=[-10:10]'; |
---|
50 | plot(jour,correlations2,'k'); |
---|
51 | hold on; |
---|
52 | plot(jour,correlations3,'k--'); |
---|
53 | axis([-10 10 -1 1]); |
---|
54 | y=zeros(21,1); |
---|
55 | plot(jour,y,'k'); |
---|
56 | |
---|
57 | figure(2); |
---|
58 | orient('landscape') |
---|
59 | |
---|
60 | plot(eof2_1030,eof3_1030,'b.'); |
---|
61 | axis([-5 5 -5 5]); |
---|
62 | y=zeros(11,1); |
---|
63 | x=[-5:5]'; |
---|
64 | hold on; |
---|
65 | plot(x,y,'k') |
---|
66 | |
---|
67 | XCentre=0; |
---|
68 | YCentre=0; |
---|
69 | Rayon=1.5; |
---|
70 | VTheta=[0:1:360]'; |
---|
71 | XCercle=zeros(360); |
---|
72 | YCercle=zeros(360); |
---|
73 | for a=1:360; |
---|
74 | XCercle(a)=XCentre+Rayon*cos((2*pi*VTheta(a))/360); |
---|
75 | YCercle(a)=YCentre+Rayon*sin((2*pi*VTheta(a))/360); |
---|
76 | end; |
---|
77 | plot(XCercle, YCercle,'k'); |
---|
78 | x=[-0.00001 0]'; |
---|
79 | y=[-5 5]'; |
---|
80 | plot(x,y,'k'); |
---|
81 | x=[-5 5]'; |
---|
82 | y=[-5 5]'; |
---|
83 | plot(x,y,'k'); |
---|
84 | x=[5 -5]'; |
---|
85 | y=[-5 5]'; |
---|
86 | plot(x,y,'k'); |
---|
87 | xlabel('EOF1'); |
---|
88 | ylabel('EOF2'); |
---|
89 | title('Phase spae points for JJAS days from 1979 to 2006'); |
---|
90 | text(-4,-1,'PHASE 1'); |
---|
91 | text(-2,-4,'PHASE 2'); |
---|
92 | text(1,-4,'PHASE 3'); |
---|
93 | text(3,-1,'PHASE 4'); |
---|
94 | text(3,1,'PHASE 5'); |
---|
95 | text(1,4,'PHASE 6'); |
---|
96 | text(-2,4,'PHASE 7'); |
---|
97 | text(-4,1,'PHASE 8'); |
---|
98 | set (gca,'tick','out'); |
---|
99 | |
---|
100 | figure(1); |
---|
101 | print('-depsc2','lag_correlations_eof2_eof3_1030.eps'); |
---|
102 | figure(2); |
---|
103 | print('-depsc2','phase_space_diagram_eof2_eof3_1030.eps'); |
---|
104 | |
---|
105 | phase1=zeros(3416,3); |
---|
106 | phase2=zeros(3416,3); |
---|
107 | phase3=zeros(3416,3); |
---|
108 | phase4=zeros(3416,3); |
---|
109 | |
---|
110 | phase5=zeros(3416,3); |
---|
111 | phase6=zeros(3416,3); |
---|
112 | phase7=zeros(3416,3); |
---|
113 | phase8=zeros(3416,3); |
---|
114 | |
---|
115 | for a=1:3416; |
---|
116 | % selection hors du cercle : il faut que la distance soit >1.5 |
---|
117 | if sqrt((eof2_1030(a))^2+(eof3_1030(a))^2) >1.5; |
---|
118 | if eof3_1030(a)<0 % selection phase 1 2 3 4 |
---|
119 | % selection phase 1 |
---|
120 | if eof3_1030(a)>eof2_1030(a); |
---|
121 | phase1(a,1)=1; |
---|
122 | phase1(a,2)=eof2_1030(a); |
---|
123 | phase1(a,3)=eof3_1030(a); |
---|
124 | % selection phase 2 |
---|
125 | elseif eof2_1030(a)<0; |
---|
126 | phase2(a,1)=1; |
---|
127 | phase2(a,2)=eof2_1030(a); |
---|
128 | phase2(a,3)=eof3_1030(a); |
---|
129 | % selection phase 3 |
---|
130 | elseif abs(eof2_1030(a))<abs(eof3_1030(a)); |
---|
131 | phase3(a,1)=1; |
---|
132 | phase3(a,2)=eof2_1030(a); |
---|
133 | phase3(a,3)=eof3_1030(a); |
---|
134 | else |
---|
135 | phase4(a,1)=1; |
---|
136 | phase4(a,2)=eof2_1030(a); |
---|
137 | phase4(a,3)=eof3_1030(a); |
---|
138 | end; |
---|
139 | % selection phase 5 6 7 8 |
---|
140 | else |
---|
141 | % selection phase 5 |
---|
142 | if eof3_1030(a)<eof2_1030(a); |
---|
143 | phase5(a,1)=1; |
---|
144 | phase5(a,2)=eof2_1030(a); |
---|
145 | phase5(a,3)=eof3_1030(a); |
---|
146 | elseif eof2_1030(a)>0; |
---|
147 | phase6(a,1)=1; |
---|
148 | phase6(a,2)=eof2_1030(a); |
---|
149 | phase6(a,3)=eof3_1030(a); |
---|
150 | % selection phase 7 |
---|
151 | elseif abs(eof2_1030(a))<abs(eof3_1030(a)); |
---|
152 | phase7(a,1)=1; |
---|
153 | phase7(a,2)=eof2_1030(a); |
---|
154 | phase7(a,3)=eof3_1030(a); |
---|
155 | else |
---|
156 | phase8(a,1)=1; |
---|
157 | phase8(a,2)=eof2_1030(a); |
---|
158 | phase8(a,3)=eof3_1030(a); |
---|
159 | end; |
---|
160 | end; |
---|
161 | end; |
---|
162 | end; |
---|
163 | |
---|
164 | save('phase1.txt','phase1','-ASCII'); |
---|
165 | save('phase2.txt','phase2','-ASCII'); |
---|
166 | save('phase3.txt','phase3','-ASCII'); |
---|
167 | save('phase4.txt','phase4','-ASCII'); |
---|
168 | |
---|
169 | save('phase5.txt','phase5','-ASCII'); |
---|
170 | save('phase6.txt','phase6','-ASCII'); |
---|
171 | save('phase7.txt','phase7','-ASCII'); |
---|
172 | save('phase8.txt','phase8','-ASCII'); |
---|