% % initialisation clear; close all; status=load('hgt500_afr.mat','hgt500'); hgt500=status.hgt500; clear status; ncload('zg_d.AfNQIVIV.197106-09.nc'); % sélection du domaine géographique hgt500b=zeros(122,29,64,128); hgt500b(:,:,:,1:64)=hgt500(:,:,:,65:128); hgt500b(:,:,:,65:128)=hgt500(:,:,:,1:64); clear hgt500; hgt500=hgt500b; clear hgt500b; % on desaisonalise hgt1=permute(hgt500,[2 1 3 4]); hgt2(:,:,:)=nanmean(hgt1); clear hgt1; hgt3=reshape(hgt500, 3538,64,128); hgt4(:,:)=nanmean(hgt3); clear hgt3; for a=1:122; for b=1:29; for c=1:37; for d=1:128; hgt500(a,b,c,d)=hgt500(a,b,c,d)-(hgt2(a,c,d)-hgt4(c,d)); end; end; end; end; clear hgt2 hgt4; status=load('eof2_AFR_1030.txt'); eof2_AFR_1030=status; clear status; % on met sous la forme annee mois hgt500_eof=reshape(eof2_AFR_1030,122,29); clear eof2_AFR_1030; % on calcule l ecart type sur la serie temporelle de l HGT500 k=122*29; hgt500bis=reshape(hgt500_eof,k,1); hgt500bis=1.25*std(hgt500bis); % intialisation des tableaux hgt500_filtre_compomax=NaN*ones(50,31,64,128); hgt500_filtre_compomin=NaN*ones(50,31,64,128); compteurmax=0; compteurmin=0; % boucle sur les annees for a=1:29; clear delta; delta=zeros(122,1); % boucle sur les jours : on prepare avant for b=1:122; if b>1; delta(b)=hgt500_eof(b,a)-hgt500_eof(b-1,a); end; end; % boucle sur les jours for b=1:122; % 1ere condition (laisser une marge de 10) if (b>20 && b<112); % cas 1 : max deltas apres negetifs et deltas avant postifs if (delta(b+1)<0 && delta(b)<0 && delta(b-1)>0 && delta(b-2)>0 && hgt500_eof(b,a)>(hgt500bis)); compteurmax=compteurmax+1; hgt500_filtre_compomax(compteurmax,1,:,:)=hgt500(b-20,a,:,:); hgt500_filtre_compomax(compteurmax,2,:,:)=hgt500(b-19,a,:,:); hgt500_filtre_compomax(compteurmax,3,:,:)=hgt500(b-18,a,:,:); hgt500_filtre_compomax(compteurmax,4,:,:)=hgt500(b-17,a,:,:); hgt500_filtre_compomax(compteurmax,5,:,:)=hgt500(b-16,a,:,:); hgt500_filtre_compomax(compteurmax,6,:,:)=hgt500(b-15,a,:,:); hgt500_filtre_compomax(compteurmax,7,:,:)=hgt500(b-14,a,:,:); hgt500_filtre_compomax(compteurmax,8,:,:)=hgt500(b-13,a,:,:); hgt500_filtre_compomax(compteurmax,9,:,:)=hgt500(b-12,a,:,:); hgt500_filtre_compomax(compteurmax,10,:,:)=hgt500(b-11,a,:,:); hgt500_filtre_compomax(compteurmax,11,:,:)=hgt500(b-10,a,:,:); hgt500_filtre_compomax(compteurmax,12,:,:)=hgt500(b-9,a,:,:); hgt500_filtre_compomax(compteurmax,13,:,:)=hgt500(b-8,a,:,:); hgt500_filtre_compomax(compteurmax,14,:,:)=hgt500(b-7,a,:,:); hgt500_filtre_compomax(compteurmax,15,:,:)=hgt500(b-6,a,:,:); hgt500_filtre_compomax(compteurmax,16,:,:)=hgt500(b-5,a,:,:); hgt500_filtre_compomax(compteurmax,17,:,:)=hgt500(b-4,a,:,:); hgt500_filtre_compomax(compteurmax,18,:,:)=hgt500(b-3,a,:,:); hgt500_filtre_compomax(compteurmax,19,:,:)=hgt500(b-2,a,:,:); hgt500_filtre_compomax(compteurmax,20,:,:)=hgt500(b-1,a,:,:); hgt500_filtre_compomax(compteurmax,21,:,:)=hgt500(b,a,:,:); hgt500_filtre_compomax(compteurmax,22,:,:)=hgt500(b+1,a,:,:); hgt500_filtre_compomax(compteurmax,23,:,:)=hgt500(b+2,a,:,:); hgt500_filtre_compomax(compteurmax,24,:,:)=hgt500(b+3,a,:,:); hgt500_filtre_compomax(compteurmax,25,:,:)=hgt500(b+4,a,:,:); hgt500_filtre_compomax(compteurmax,26,:,:)=hgt500(b+5,a,:,:); hgt500_filtre_compomax(compteurmax,27,:,:)=hgt500(b+6,a,:,:); hgt500_filtre_compomax(compteurmax,28,:,:)=hgt500(b+7,a,:,:); hgt500_filtre_compomax(compteurmax,29,:,:)=hgt500(b+8,a,:,:); hgt500_filtre_compomax(compteurmax,30,:,:)=hgt500(b+9,a,:,:); hgt500_filtre_compomax(compteurmax,31,:,:)=hgt500(b+10,a,:,:); % cas 2 : min deltas apres positifs et deltas avant negatifs elseif (delta(b+1)>0 && delta(b)>0 && delta(b-1)<0 && delta(b-2)<0 && hgt500_eof(b,a)<(-hgt500bis)); compteurmin=compteurmin+1; hgt500_filtre_compomin(compteurmin,1,:,:)=hgt500(b-20,a,:,:); hgt500_filtre_compomin(compteurmin,2,:,:)=hgt500(b-19,a,:,:); hgt500_filtre_compomin(compteurmin,3,:,:)=hgt500(b-18,a,:,:); hgt500_filtre_compomin(compteurmin,4,:,:)=hgt500(b-17,a,:,:); hgt500_filtre_compomin(compteurmin,5,:,:)=hgt500(b-16,a,:,:); hgt500_filtre_compomin(compteurmin,6,:,:)=hgt500(b-15,a,:,:); hgt500_filtre_compomin(compteurmin,7,:,:)=hgt500(b-14,a,:,:); hgt500_filtre_compomin(compteurmin,8,:,:)=hgt500(b-13,a,:,:); hgt500_filtre_compomin(compteurmin,9,:,:)=hgt500(b-12,a,:,:); hgt500_filtre_compomin(compteurmin,10,:,:)=hgt500(b-11,a,:,:); hgt500_filtre_compomin(compteurmin,11,:,:)=hgt500(b-10,a,:,:); hgt500_filtre_compomin(compteurmin,12,:,:)=hgt500(b-9,a,:,:); hgt500_filtre_compomin(compteurmin,13,:,:)=hgt500(b-8,a,:,:); hgt500_filtre_compomin(compteurmin,14,:,:)=hgt500(b-7,a,:,:); hgt500_filtre_compomin(compteurmin,15,:,:)=hgt500(b-6,a,:,:); hgt500_filtre_compomin(compteurmin,16,:,:)=hgt500(b-5,a,:,:); hgt500_filtre_compomin(compteurmin,17,:,:)=hgt500(b-4,a,:,:); hgt500_filtre_compomin(compteurmin,18,:,:)=hgt500(b-3,a,:,:); hgt500_filtre_compomin(compteurmin,19,:,:)=hgt500(b-2,a,:,:); hgt500_filtre_compomin(compteurmin,20,:,:)=hgt500(b-1,a,:,:); hgt500_filtre_compomin(compteurmin,21,:,:)=hgt500(b,a,:,:); hgt500_filtre_compomin(compteurmin,22,:,:)=hgt500(b+1,a,:,:); hgt500_filtre_compomin(compteurmin,23,:,:)=hgt500(b+2,a,:,:); hgt500_filtre_compomin(compteurmin,24,:,:)=hgt500(b+3,a,:,:); hgt500_filtre_compomin(compteurmin,25,:,:)=hgt500(b+4,a,:,:); hgt500_filtre_compomin(compteurmin,26,:,:)=hgt500(b+5,a,:,:); hgt500_filtre_compomin(compteurmin,27,:,:)=hgt500(b+6,a,:,:); hgt500_filtre_compomin(compteurmin,28,:,:)=hgt500(b+7,a,:,:); hgt500_filtre_compomin(compteurmin,29,:,:)=hgt500(b+8,a,:,:); hgt500_filtre_compomin(compteurmin,30,:,:)=hgt500(b+9,a,:,:); hgt500_filtre_compomin(compteurmin,31,:,:)=hgt500(b+10,a,:,:); end; end; end; end; siz=122*29; hgt500=reshape(hgt500,siz,64,128); clear hgt hgt(:,:)=mean(hgt500); % on fait le test de Student nb_value=min(compteurmin,compteurmax); student1=zeros(31,64,128); for a=1:31; for b=1:64; for c=1:128; x=hgt500_filtre_compomin(1:nb_value,a,b,c); y=hgt500_filtre_compomax(1:nb_value,a,b,c); student1(a,b,c)=ttest(x,y,.1); end; end; end; disp(['iii : compteurmin =', int2str(compteurmin)]); disp(['iii : compteurmax =', int2str(compteurmax)]); hgt500_filtre_compomin=hgt500_filtre_compomin(1:compteurmin,:,:,:); hgt500_filtre_compomax=hgt500_filtre_compomax(1:compteurmax,:,:,:); % on fait la somme des valeurs de hgt500_filtreentiel sur le nbre d occurences % on obtent un tableau de la forme (jours-avant-apres,lon,lat) hgt500_filtre_compomin1(:,:,:)=mean(hgt500_filtre_compomin); clear hgt500_filtre_compomin; hgt500_filtre_compomax1(:,:,:)=mean(hgt500_filtre_compomax); clear hgt500_filtre_compomax; x=[-10:1:10]'; figure(1); orient('landscape'); lat=lat'; lon=lon-180; for e=1:7; a=7-(e-1)+1; f=2*(a-1)+1; clear delta_hgt500_filtre_min; delta_hgt500_filtre_min=zeros(64,128); for b=1:64; for c=1:128; % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); if student1(f,b,c)==1; delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); else % delta_hgt500_filtre_min(b,c)=NaN; end; end; end; for b=1:64; for c=1:128; if delta_hgt500_filtre_min(b,c)<-50; delta_hgt500_filtre_min(b,c)=-50; elseif delta_hgt500_filtre_min(b,c)>50; delta_hgt500_filtre_min(b,c)=50; end; end; end; subplot(7,1,8-e); palettecomplet delta_hgt500_filtre_min(1,1)=-50.0001; delta_hgt500_filtre_min(1,2)=50.0001; fin=-30+24*2.5; clear fin fin=-10+16*2.5; aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); if e==1; set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); else set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); end; set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); if e==4; co=colorbar; set (co,'ytick',[-50:5:50],'yticklabel',[-50:5:50],'fontname','Arial','fontsize',5); end; hold on; cartemonde1; set (gca,'tickDir','out'); axis equal axis([-180 180 20 80]); if e==7; title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; end; text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); pos_vert=e/10; set (gca,'position',[0.2 pos_vert 0.5 0.1]) end; print('-depsc2','composite_hgt500_afr_eof2_1030a.eps'); figure(2); orient('landscape'); for e=1:7; a=7-(e-1)+1+7; f=2*(a-1)+1; clear delta_hgt500_filtre_min; delta_hgt500_filtre_min=zeros(64,128); for b=1:64; for c=1:128; % delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt500_filtre_compomax1(f,b,c); % delta_hgt500_filtre_min(b,c)=-(hgt500_filtre_compomax1(f,b,c)-hgt(b,c)); delta_hgt500_filtre_min(b,c)=hgt500_filtre_compomin1(f,b,c)-hgt(b,c); if student1(f,b,c)==1; delta_hgt500_filtre_min(b,c)=delta_hgt500_filtre_min(b,c); else % delta_hgt500_filtre_min(b,c)=NaN; end; end; end; for b=1:64; for c=1:128; if delta_hgt500_filtre_min(b,c)<-50; delta_hgt500_filtre_min(b,c)=-50; elseif delta_hgt500_filtre_min(b,c)>50; delta_hgt500_filtre_min(b,c)=50; end; end; end; subplot(7,1,8-e); palettecomplet delta_hgt500_filtre_min(1,1)=-50.0001; delta_hgt500_filtre_min(1,2)=50.0001; fin=-30+24*2.5; clear fin fin=-10+16*2.5; aa=contourf(lon,lat,delta_hgt500_filtre_min,[-50:5:50],'LineStyle','none'); if e==1; set (gca,'XTick',[-180:60:180],'XTickLabel',[' 180';'120W';' 60W';' 0';' 60E';'120E';' 180'],'fontname','Arial','fontsize',6); else set (gca,'XTick',[-180:60:180],'XTickLabel',[' ';' ';' ';' ';' ';' '],'fontname','Arial','fontsize',6); end; set (gca,'YTick',[30:10:70],'YTickLabel',['30N';'40N';'50N';'60N';'70N'],'fontname','Arial','fontsize',6); if e==4; co=colorbar; set (co,'ytick',[-40:20:40],'yticklabel',[-40:20:40],'fontname','Arial','fontsize',5); end; hold on; cartemonde1; set (gca,'tickDir','out'); axis equal axis([-180 180 20 80]); if e==7; title('HGT500 composite EOF2 1030j simulation AFR','fontsize',8) ; end; text(-270,40,['day = ',num2str(f-21)],'fontname','Arial','fontsize',10); pos_vert=e/10; set (gca,'position',[0.2 pos_vert 0.5 0.1]) end; print('-depsc2','composite_hgt500_afr_eof2_1030b.eps');