[17] | 1 | % |
---|
| 2 | |
---|
| 3 | % initialisation |
---|
| 4 | clear; |
---|
| 5 | close all; |
---|
| 6 | |
---|
[24] | 7 | status=load('hgt500_afr.mat','hgt500'); |
---|
| 8 | hgt500=status.hgt500; |
---|
| 9 | clear status; |
---|
[17] | 10 | |
---|
| 11 | ncload('zg_d.AfNQIVIV.197106-09.nc'); |
---|
| 12 | |
---|
| 13 | % selction du domaine geographique |
---|
| 14 | hgt500b=zeros(122,29,64,128); |
---|
| 15 | hgt500b(:,:,:,1:64)=hgt500(:,:,:,65:128); |
---|
| 16 | hgt500b(:,:,:,65:128)=hgt500(:,:,:,1:64); |
---|
| 17 | clear hgt500; |
---|
| 18 | hgt500=hgt500b; |
---|
| 19 | clear hgt500b; |
---|
| 20 | |
---|
| 21 | % on desaisonalise |
---|
| 22 | hgt1=permute(hgt500,[2 1 3 4]); |
---|
| 23 | hgt2(:,:,:)=nanmean(hgt1); |
---|
| 24 | clear hgt1; |
---|
| 25 | hgt3=reshape(hgt500, 3538,64,128); |
---|
| 26 | hgt4(:,:)=nanmean(hgt3); |
---|
| 27 | clear hgt3; |
---|
| 28 | |
---|
| 29 | for a=1:122; |
---|
| 30 | for b=1:29; |
---|
| 31 | for c=1:37; |
---|
| 32 | for d=1:128; |
---|
| 33 | hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d)); |
---|
| 34 | end; |
---|
| 35 | end; |
---|
| 36 | end; |
---|
| 37 | end; |
---|
| 38 | clear hgt2 hgt4; |
---|
| 39 | |
---|
[23] | 40 | status=load('eof2_AFR_1030.txt'); |
---|
[24] | 41 | eof2_AFR_1030=status; |
---|
| 42 | clear status; |
---|
[17] | 43 | |
---|
| 44 | % on met sous la forme annee mois |
---|
| 45 | hgt500_eof=reshape(eof2_AFR_1030,122,29); |
---|
| 46 | clear eof2_AFR_1030; |
---|
| 47 | |
---|
| 48 | % on calcule l ecart type sur la serie temporelle de l HGT500 |
---|
| 49 | k=122*29; |
---|
| 50 | hgt500bis=reshape(hgt500_eof,k,1); |
---|
| 51 | hgt500bis=1.25*std(hgt500bis); |
---|
| 52 | |
---|
| 53 | % intialisation des tableaux |
---|
| 54 | hgt500_filtre_compomax=NaN*ones(50,31,64,128); |
---|
| 55 | hgt500_filtre_compomin=NaN*ones(50,31,64,128); |
---|
| 56 | |
---|
| 57 | compteurmax=0; |
---|
| 58 | compteurmin=0; |
---|
| 59 | |
---|
| 60 | % boucle sur les annees |
---|
| 61 | for a=1:29; |
---|
| 62 | clear delta; |
---|
| 63 | delta=zeros(122,1); |
---|
| 64 | % boucle sur les jours : on prepare avant |
---|
| 65 | for b=1:122; |
---|
| 66 | if b>1; |
---|
| 67 | delta(b)=hgt500_eof(b,a)-hgt500_eof(b-1,a); |
---|
| 68 | end; |
---|
| 69 | end; |
---|
| 70 | % boucle sur les jours |
---|
| 71 | for b=1:122; |
---|
| 72 | % 1ere condition (laisser une marge de 10) |
---|
| 73 | if (b>20 && b<112); |
---|
| 74 | % cas 1 : max deltas apres negetifs et deltas avant postifs |
---|
| 75 | if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && hgt500_eof(b,a)>(hgt500bis)); |
---|
| 76 | compteurmax=compteurmax+1; |
---|
| 77 | hgt500_filtre_compomax(compteurmax,1,:,:)=hgt500(b-20,a,:,:); |
---|
| 78 | hgt500_filtre_compomax(compteurmax,2,:,:)=hgt500(b-19,a,:,:); |
---|
| 79 | hgt500_filtre_compomax(compteurmax,3,:,:)=hgt500(b-18,a,:,:); |
---|
| 80 | hgt500_filtre_compomax(compteurmax,4,:,:)=hgt500(b-17,a,:,:); |
---|
| 81 | hgt500_filtre_compomax(compteurmax,5,:,:)=hgt500(b-16,a,:,:); |
---|
| 82 | hgt500_filtre_compomax(compteurmax,6,:,:)=hgt500(b-15,a,:,:); |
---|
| 83 | hgt500_filtre_compomax(compteurmax,7,:,:)=hgt500(b-14,a,:,:); |
---|
| 84 | hgt500_filtre_compomax(compteurmax,8,:,:)=hgt500(b-13,a,:,:); |
---|
| 85 | hgt500_filtre_compomax(compteurmax,9,:,:)=hgt500(b-12,a,:,:); |
---|
| 86 | hgt500_filtre_compomax(compteurmax,10,:,:)=hgt500(b-11,a,:,:); |
---|
| 87 | |
---|
| 88 | hgt500_filtre_compomax(compteurmax,11,:,:)=hgt500(b-10,a,:,:); |
---|
| 89 | hgt500_filtre_compomax(compteurmax,12,:,:)=hgt500(b-9,a,:,:); |
---|
| 90 | hgt500_filtre_compomax(compteurmax,13,:,:)=hgt500(b-8,a,:,:); |
---|
| 91 | hgt500_filtre_compomax(compteurmax,14,:,:)=hgt500(b-7,a,:,:); |
---|
| 92 | hgt500_filtre_compomax(compteurmax,15,:,:)=hgt500(b-6,a,:,:); |
---|
| 93 | hgt500_filtre_compomax(compteurmax,16,:,:)=hgt500(b-5,a,:,:); |
---|
| 94 | hgt500_filtre_compomax(compteurmax,17,:,:)=hgt500(b-4,a,:,:); |
---|
| 95 | hgt500_filtre_compomax(compteurmax,18,:,:)=hgt500(b-3,a,:,:); |
---|
| 96 | hgt500_filtre_compomax(compteurmax,19,:,:)=hgt500(b-2,a,:,:); |
---|
| 97 | hgt500_filtre_compomax(compteurmax,20,:,:)=hgt500(b-1,a,:,:); |
---|
| 98 | |
---|
| 99 | hgt500_filtre_compomax(compteurmax,21,:,:)=hgt500(b,a,:,:); |
---|
| 100 | hgt500_filtre_compomax(compteurmax,22,:,:)=hgt500(b+1,a,:,:); |
---|
| 101 | hgt500_filtre_compomax(compteurmax,23,:,:)=hgt500(b+2,a,:,:); |
---|
| 102 | hgt500_filtre_compomax(compteurmax,24,:,:)=hgt500(b+3,a,:,:); |
---|
| 103 | hgt500_filtre_compomax(compteurmax,25,:,:)=hgt500(b+4,a,:,:); |
---|
| 104 | hgt500_filtre_compomax(compteurmax,26,:,:)=hgt500(b+5,a,:,:); |
---|
| 105 | hgt500_filtre_compomax(compteurmax,27,:,:)=hgt500(b+6,a,:,:); |
---|
| 106 | hgt500_filtre_compomax(compteurmax,28,:,:)=hgt500(b+7,a,:,:); |
---|
| 107 | hgt500_filtre_compomax(compteurmax,29,:,:)=hgt500(b+8,a,:,:); |
---|
| 108 | hgt500_filtre_compomax(compteurmax,30,:,:)=hgt500(b+9,a,:,:); |
---|
| 109 | hgt500_filtre_compomax(compteurmax,31,:,:)=hgt500(b+10,a,:,:); |
---|
| 110 | % cas 2 : min deltas apres positifs et deltas avant negatifs |
---|
| 111 | elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && hgt500_eof(b,a)<(-hgt500bis)); |
---|
| 112 | compteurmin=compteurmin+1; |
---|
| 113 | |
---|
| 114 | hgt500_filtre_compomin(compteurmin,1,:,:)=hgt500(b-20,a,:,:); |
---|
| 115 | hgt500_filtre_compomin(compteurmin,2,:,:)=hgt500(b-19,a,:,:); |
---|
| 116 | hgt500_filtre_compomin(compteurmin,3,:,:)=hgt500(b-18,a,:,:); |
---|
| 117 | hgt500_filtre_compomin(compteurmin,4,:,:)=hgt500(b-17,a,:,:); |
---|
| 118 | hgt500_filtre_compomin(compteurmin,5,:,:)=hgt500(b-16,a,:,:); |
---|
| 119 | hgt500_filtre_compomin(compteurmin,6,:,:)=hgt500(b-15,a,:,:); |
---|
| 120 | hgt500_filtre_compomin(compteurmin,7,:,:)=hgt500(b-14,a,:,:); |
---|
| 121 | hgt500_filtre_compomin(compteurmin,8,:,:)=hgt500(b-13,a,:,:); |
---|
| 122 | hgt500_filtre_compomin(compteurmin,9,:,:)=hgt500(b-12,a,:,:); |
---|
| 123 | hgt500_filtre_compomin(compteurmin,10,:,:)=hgt500(b-11,a,:,:); |
---|
| 124 | |
---|
| 125 | hgt500_filtre_compomin(compteurmin,11,:,:)=hgt500(b-10,a,:,:); |
---|
| 126 | hgt500_filtre_compomin(compteurmin,12,:,:)=hgt500(b-9,a,:,:); |
---|
| 127 | hgt500_filtre_compomin(compteurmin,13,:,:)=hgt500(b-8,a,:,:); |
---|
| 128 | hgt500_filtre_compomin(compteurmin,14,:,:)=hgt500(b-7,a,:,:); |
---|
| 129 | hgt500_filtre_compomin(compteurmin,15,:,:)=hgt500(b-6,a,:,:); |
---|
| 130 | hgt500_filtre_compomin(compteurmin,16,:,:)=hgt500(b-5,a,:,:); |
---|
| 131 | hgt500_filtre_compomin(compteurmin,17,:,:)=hgt500(b-4,a,:,:); |
---|
| 132 | hgt500_filtre_compomin(compteurmin,18,:,:)=hgt500(b-3,a,:,:); |
---|
| 133 | hgt500_filtre_compomin(compteurmin,19,:,:)=hgt500(b-2,a,:,:); |
---|
| 134 | hgt500_filtre_compomin(compteurmin,20,:,:)=hgt500(b-1,a,:,:); |
---|
| 135 | |
---|
| 136 | hgt500_filtre_compomin(compteurmin,21,:,:)=hgt500(b,a,:,:); |
---|
| 137 | hgt500_filtre_compomin(compteurmin,22,:,:)=hgt500(b+1,a,:,:); |
---|
| 138 | hgt500_filtre_compomin(compteurmin,23,:,:)=hgt500(b+2,a,:,:); |
---|
| 139 | hgt500_filtre_compomin(compteurmin,24,:,:)=hgt500(b+3,a,:,:); |
---|
| 140 | hgt500_filtre_compomin(compteurmin,25,:,:)=hgt500(b+4,a,:,:); |
---|
| 141 | hgt500_filtre_compomin(compteurmin,26,:,:)=hgt500(b+5,a,:,:); |
---|
| 142 | hgt500_filtre_compomin(compteurmin,27,:,:)=hgt500(b+6,a,:,:); |
---|
| 143 | hgt500_filtre_compomin(compteurmin,28,:,:)=hgt500(b+7,a,:,:); |
---|
| 144 | hgt500_filtre_compomin(compteurmin,29,:,:)=hgt500(b+8,a,:,:); |
---|
| 145 | hgt500_filtre_compomin(compteurmin,30,:,:)=hgt500(b+9,a,:,:); |
---|
| 146 | hgt500_filtre_compomin(compteurmin,31,:,:)=hgt500(b+10,a,:,:); |
---|
| 147 | end; |
---|
| 148 | end; |
---|
| 149 | end; |
---|
| 150 | end; |
---|
| 151 | siz=122*29; |
---|
| 152 | hgt500=reshape(hgt500,siz,64,128); |
---|
| 153 | clear hgt |
---|
| 154 | hgt(:,:)=mean(hgt500); |
---|
| 155 | |
---|
| 156 | % on fait le test de Student |
---|
| 157 | nb_value=min(compteurmin,compteurmax); |
---|
| 158 | student1=zeros(31,64,128); |
---|
| 159 | for a=1:31; |
---|
| 160 | for b=1:64; |
---|
| 161 | for c=1:128; |
---|
| 162 | x=hgt500_filtre_compomin(1:nb_value,a,b,c); |
---|
| 163 | y=hgt500_filtre_compomax(1:nb_value,a,b,c); |
---|
| 164 | student1(a,b,c)=ttest(x,y,.1); |
---|
| 165 | end |
---|
| 166 | end |
---|
| 167 | end |
---|
| 168 | disp(['iii : compteurmin =', int2str(compteurmin)]); |
---|
| 169 | disp(['iii : compteurmax =', int2str(compteurmax)]); |
---|
| 170 | hgt500_filtre_compomin=hgt500_filtre_compomin(1:compteurmin,:,:,:); |
---|
| 171 | hgt500_filtre_compomax=hgt500_filtre_compomax(1:compteurmax,:,:,:); |
---|
| 172 | |
---|
| 173 | % on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences |
---|
| 174 | % on obtent un tableau de la forme (jours-avant-apres,lon,lat) |
---|
| 175 | hgt500_filtre_compomin1(:,:,:)=mean(hgt500_filtre_compomin); |
---|
| 176 | clear hgt500_filtre_compomin; |
---|
| 177 | hgt500_filtre_compomax1(:,:,:)=mean(hgt500_filtre_compomax); |
---|
| 178 | clear hgt500_filtre_compomax; |
---|
| 179 | |
---|
| 180 | x=[-10:1:10]'; |
---|
| 181 | |
---|
| 182 | figure(1); |
---|
| 183 | orient('landscape'); |
---|
| 184 | |
---|
| 185 | lat=lat'; |
---|
| 186 | lon=lon-180; |
---|
| 187 | for e=1:7; |
---|
| 188 | a=7-(e-1)+1; |
---|
| 189 | f=2*(a-1)+1; |
---|
| 190 | clear delta_hgt500_filtre_min; |
---|
| 191 | delta_hgt500_filtre_min=zeros(64,128); |
---|
| 192 | for b=1:64; |
---|
| 193 | for c=1:128; |
---|
| 194 | % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); |
---|
| 195 | % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); |
---|
| 196 | delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); |
---|
| 197 | if student1(f,b,c)==1; |
---|
| 198 | delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); |
---|
| 199 | else |
---|
| 200 | % delta_hgt500_filtre_min(b,c)=NaN; |
---|
| 201 | end; |
---|
| 202 | end; |
---|
| 203 | end; |
---|
| 204 | for b=1:64; |
---|
| 205 | for c=1:128; |
---|
| 206 | if delta_hgt500_filtre_min(b,c)<-50; |
---|
| 207 | delta_hgt500_filtre_min(b,c)=-50; |
---|
| 208 | elseif delta_hgt500_filtre_min(b,c)>50; |
---|
| 209 | delta_hgt500_filtre_min(b,c)=50; |
---|
| 210 | end; |
---|
| 211 | end; |
---|
| 212 | end |
---|
| 213 | subplot(7,1,8-e); |
---|
| 214 | palettecomplet |
---|
| 215 | delta_hgt500_filtre_min(1,1)=-50.0001; |
---|
| 216 | delta_hgt500_filtre_min(1,2)=50.0001; |
---|
| 217 | fin=-30+24*2.5; |
---|
| 218 | |
---|
| 219 | clear fin |
---|
| 220 | fin=-10+16*2.5; |
---|
| 221 | aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); |
---|
| 222 | if e==1; |
---|
| 223 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); |
---|
| 224 | else |
---|
| 225 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); |
---|
| 226 | end |
---|
| 227 | set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); |
---|
| 228 | if e==4; |
---|
| 229 | co=colorbar; |
---|
[21] | 230 | set (co,'ytick',[-50:5:50],'yticklabel',[-50:5:50],'fontname','Arial','fontsize',5); |
---|
[17] | 231 | end; |
---|
| 232 | hold on; |
---|
| 233 | cartemonde1; |
---|
| 234 | set (gca,'tickDir','out'); |
---|
| 235 | axis equal |
---|
| 236 | axis([-180 180 20 80]); |
---|
| 237 | if e==7; |
---|
[21] | 238 | title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; |
---|
[17] | 239 | end |
---|
| 240 | text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); |
---|
| 241 | pos_vert=e/10; |
---|
| 242 | set (gca,'position',[0.2 pos_vert 0.5 0.1]) |
---|
| 243 | end; |
---|
[24] | 244 | print('-depsc2','composite_hgt500_afr_eof2_1030a.eps'); |
---|
[17] | 245 | |
---|
| 246 | figure(2); |
---|
| 247 | orient('landscape'); |
---|
| 248 | |
---|
| 249 | for e=1:7; |
---|
| 250 | a=7-(e-1)+1+7; |
---|
| 251 | f=2*(a-1)+1; |
---|
| 252 | clear delta_hgt500_filtre_min; |
---|
| 253 | delta_hgt500_filtre_min=zeros(64,128); |
---|
| 254 | for b=1:64; |
---|
| 255 | for c=1:128; |
---|
| 256 | % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); |
---|
| 257 | % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); |
---|
| 258 | delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); |
---|
| 259 | if student1(f,b,c)==1; |
---|
| 260 | delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); |
---|
| 261 | else |
---|
| 262 | % delta_hgt500_filtre_min(b,c)=NaN; |
---|
| 263 | end; |
---|
| 264 | end; |
---|
| 265 | end; |
---|
| 266 | for b=1:64; |
---|
| 267 | for c=1:128; |
---|
| 268 | if delta_hgt500_filtre_min(b,c)<-50; |
---|
| 269 | delta_hgt500_filtre_min(b,c)=-50; |
---|
| 270 | elseif delta_hgt500_filtre_min(b,c)>50; |
---|
| 271 | delta_hgt500_filtre_min(b,c)=50; |
---|
| 272 | end; |
---|
| 273 | end; |
---|
| 274 | end |
---|
| 275 | subplot(7,1,8-e); |
---|
| 276 | palettecomplet |
---|
| 277 | delta_hgt500_filtre_min(1,1)=-50.0001; |
---|
| 278 | delta_hgt500_filtre_min(1,2)=50.0001; |
---|
| 279 | fin=-30+24*2.5; |
---|
| 280 | |
---|
| 281 | clear fin |
---|
| 282 | fin=-10+16*2.5; |
---|
| 283 | aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); |
---|
| 284 | if e==1; |
---|
| 285 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); |
---|
| 286 | else |
---|
| 287 | set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); |
---|
| 288 | end |
---|
| 289 | set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); |
---|
| 290 | if e==4; |
---|
| 291 | co=colorbar; |
---|
[21] | 292 | set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',5); |
---|
[17] | 293 | end; |
---|
| 294 | hold on; |
---|
| 295 | cartemonde1; |
---|
| 296 | set (gca,'tickDir','out'); |
---|
| 297 | axis equal |
---|
| 298 | axis([-180 180 20 80]); |
---|
| 299 | if e==7; |
---|
[21] | 300 | title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; |
---|
[17] | 301 | end |
---|
| 302 | text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); |
---|
| 303 | pos_vert=e/10; |
---|
| 304 | set (gca,'position',[0.2 pos_vert 0.5 0.1]) |
---|
| 305 | end; |
---|
[24] | 306 | print('-depsc2','composite_hgt500_afr_eof2_1030b.eps'); |
---|