function reconstitution_ER_rossby_df(period1, period2) % reconstitution_ER_rossby_df ++explication between period1 days and period2 days %+ % % .. _reconstitution_ER_rossby_df.m: % % ============================= % reconstitution_ER_rossby_df.m % ============================= % % ++ % % DESCRIPTION % =========== % % plot ++ from file :file:`eof_rossby_jjas_2006_10-30d.mat`, % produce a ASCII file :file:`eof12_rossby_10-30d.txt`, % produce 3 Postscript files :file:`reconstitution1_eof12_filtreER_10-30d.eps`. % % EXAMPLES % ======== % % Following line read :file:`eof_rossby_jjas_2006_10-30d.mat`, produce an ASCII file % :file:`eof12_rossby_10-30d.txt`, produce 3 Postscript files % :file:`reconstitution1_eof12_filtreER_10-30d.eps`:: % % >> reconstitution_ER_rossby_df(10,30); % % SEE ALSO % ======== % % :ref:`carte_eof_ER_jjas_df.m` % % :ref:`carte_eofER_1030_article.m` % % :ref:`time_serie_ER_rossby_df.m` % % TODO % ==== % % improve description % % improve file pb % % use return function % % clean variables and plot % % EVOLUTIONS % ========== % % $Id$ % % - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) % % * add try/catch on opening file for reading % % - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) % % * replace ndmin by period1 and ndmax by period2 % % - fplod 2009-01-28T07:50:45Z aedon.locean-ipsl.upmc.fr (Darwin) % % * created from reconstitution_ER_rossby_1030.m to replace it as well as % reconstitution_ER_rossby_30100.m % % Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames. % %- global IRCAAM_ID; global IRCAAM_OD; if nargin==2 % period1 must be lower than period2 if (period1 > period2) disp(['period1 = ', int2str(period1)]); disp(['period2 = ', int2str(period2)]); error('eee : period1 must be lower than period2'); end else usage='usage : reconstitution_ER_rossby_df(period1, period2)'; disp(usage); error('eee : wrong arguments numbers') end % period1 and period2 will be used in xx-yyd form in filenames df = [int2str(period1),'-',int2str(period2),'d']; clear period1; clear period2; close all; %lon=[-30:2.5:30], lat=[-10:2.5:30] fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; try status=load(fullfilename,'C','olr'); catch error('eee : File %s not found\n', fullfilename); end clear fullfilename; C=status.C; olr=status.olr; clear status; olr=olr'; PC1=olr*C; cosa=zeros(3,3416,425); % boucle sur les VP for a=1:3; for b=1:3416 % boucle sur le temps for c=1:425 % boucle sur l espace cosa(a,b,c)=PC1(b,426-a)*C(c,426-a); end; end; end; cosa1(:,:)=cosa(1,:,:); cosa1=reshape(cosa1,3416,25,17); cosa2(:,:)=cosa(2,:,:); cosa2=reshape(cosa2,3416,25,17); cosabis=cosa(1:2,:,:); cosa12(:,:)=sum(cosabis); clear cosabis; cosa12=reshape(cosa12,3416,25,17); figure(1); orient('landscape') figure(2); orient('landscape') figure(3); orient('landscape') % On selectionne la demaine geographique % la latitude : 7.5N (8) 12.5N (10) % la longitude : 10W (9) 10E(17) lat1=8; lat2=10; lon1=9; lon2=17; taille=(lat2-lat1+1)*(lon2-lon1+1); cosa12=cosa12(:,lon1:lon2,lat1:lat2); clear cosi2; cosa12=reshape(cosa12,3416,taille); cosa12=cosa12'; cosa12=mean(cosa12); cosa12=cosa12'; fullfilename=[IRCAAM_ID,'eof12_rossby_',df,'.txt']; save(fullfilename,'cosa12','-ASCII'); clear fullfilename; cosa12=reshape(cosa12,122,28); % On selectionne la demaine geographique olr=reshape(olr,3416,25,17); cosa4=olr(:,lon1:lon2,lat1:lat2); clear olr; cosa4=reshape(cosa4,3416,taille); clear taille; cosa4=cosa4'; cosa4=mean(cosa4); cosa4=cosa4'; cosa4=reshape(cosa4,122,28); for a=1:28; if a<12; figure(1); subplot(4,3,a); elseif a<24 figure(2); subplot(4,3,a-11); else figure(3); subplot(4,3,a-23); end; y2=cosa12(:,a); y4=cosa4(:,a); x=[1:122]'; plot(x,y2); hold on; plot(x,y4,'k'); y5=zeros(122,1); plot(x,y5,'k:'); title(a+1978,'Fontsize',8); if a==2; text(0,65,'OLR 5 -17.5N et 10W - 10E'); elseif a==13; text(0,65,'OLR 5 - 17.5N et 10W - 10E'); end; set (gca,'tickDir','out'); if a==11; aa=legend('OLR VP1-2','OLR NOAA'); set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.1270 0.1642]) legend boxoff; elseif a==22; clear aa; aa=legend('OLR VP1-2','OLR NOAA'); set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.1270 0.1642]) legend boxoff; end; axis([1 122 -15 15]); set (gca,'YTick',[-15:5:15],'YTickLabel',[-15:5:15],'fontname','Arial','fontsize',6); set (gca,'XTick',[10:10:122],'XTickLabel',[10:10:122],'fontname','Arial','fontsize',6); end; figure(1); fullfilename=[IRCAAM_OD,'reconstitution1_eof12_filtreER_',df,'.eps']; print('-depsc2',fullfilename); clear fullfilename; figure(2); fullfilename=[IRCAAM_OD,'reconstitution2_eof12_filtreER_',df,'.eps']; print('-depsc2',fullfilename); clear fullfilename; figure(3); fullfilename=[IRCAAM_OD,'reconstitution3_eof12_filtreER_',df,'.eps']; print('-depsc2',fullfilename); clear fullfilename;