source: trunk/src/mode_sahelien/time_serie_ER_rossby_df_complet.m @ 59

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

add some try/catch on opening file for reading

File size: 3.7 KB
Line 
1function time_serie_ER_rossby_df_complet(period1, period2)
2% time_serie_ER_rossby_df_complet ++explication between period1 days and period2 days
3
4%+
5% module
6% ======
7%
8% ++
9%
10% DESCRIPTION
11% ===========
12%
13% plot ++ from file eof_rossby_jjas_2006_10-30d.mat
14%
15% EXAMPLES
16% ========
17%
18% Following line read eof_rossby_jjas_2006_10-30d.mat, plot ++and produce Postscript files time_serie_eof_ER_10-30d_part*.eps.
19% ::
20%
21% >> time_serie_ER_rossby_df_complet(10,30);
22%
23% SEE ALSO
24% ========
25%
26% olr_eof_jjas2006_rossby_df.m_
27%
28% .. _olr_eof_jjas2006_rossby_df.m : olr_eof_jjas2006_rossby_df.m.html
29%
30% carte_eofER_1030_article.m_
31%
32% .. _carte_eofER_1030_article.m : carte_eofER_1030_article.m.html
33%
34% carte_eof_ER_jjas_df.m_
35%
36% .. _carte_eof_ER_jjas_df.m : carte_eof_ER_jjas_df.m.html
37%
38% time_serie_ER_rossby_df.m_
39%
40% .. _time_serie_ER_rossby_df.m : time_serie_ER_rossby_df.m.html
41%
42% TODO
43% ====
44%
45% improve description
46%
47% improve file pb
48%
49% use return function
50%
51% EVOLUTIONS
52% ==========
53%
54% $Id$
55%
56% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
57%
58%   * add try/catch on opening file for reading
59%
60% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin)
61%
62%   * replace ndmin by period1 and ndmax by period2
63%
64% - fplod 2009-01-27T11:51:31Z aedon.locean-ipsl.upmc.fr (Darwin)
65%
66%   * created from time_serie_ER_rossby_1030_complet.m to replace it as well as
67%     time_serie_ER_rossby_30100_complet.m
68%
69%     Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames.
70%
71%-
72
73global IRCAAM_ID;
74global IRCAAM_OD;
75
76if nargin==2
77 % period1 must be lower than period2
78 if (period1 > period2)
79  disp(['period1 = ', int2str(period1)]);
80  disp(['period2 = ', int2str(period2)]);
81  error('eee : period1 must be lower than period2');
82 end
83else
84  usage='usage : time_serie_ER_rossby_df(period1, period2)';
85  disp(usage);
86  error('eee : wrong arguments numbers')
87end
88
89% period1 and period2 will be used in xx-yyd form in filenames
90df = [int2str(period1),'-',int2str(period2),'d'];
91clear period1;
92clear period2;
93
94close all;
95
96figure(1);
97orient('landscape')
98figure(2);
99orient('landscape')
100figure(3);
101orient('landscape')
102
103fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat'];
104try
105 status=load(fullfilename,'C','olr');
106catch
107 error('eee : File %s not found\n', fullfilename);
108end
109
110clear fullfilename;
111C=status.C;
112olr=status.olr;
113clear status;
114
115olr=olr';
116PC1=olr*C;
117
118time_serie_olr1=PC1(:,425);
119time_serie_olr2=PC1(:,424);
120
121for a=1:28;
122   if a<12;
123      figure(1);
124      subplot(4,3,a);
125   elseif a<23;
126      figure(2);
127      subplot(4,3,a-11);
128   else
129      figure(3);
130      subplot(4,3,a-22);
131   end;
132   clear koro1
133   debut=(a-1)*122+1;
134   fin=a*122;
135   koro1=time_serie_olr1(debut:fin);
136   koro2=time_serie_olr2(debut:fin);
137   x=[1:122]';
138   aa=plot(x,-koro1,'r');
139   hold on;
140   bb=plot(x,-koro2,'k');
141%   cc=legend('EOF1','EOF2')
142%   set (cc,'fontsize',6)
143%   legend boxoff;
144   y=zeros(122,1);
145   plot(x,y,'k:');
146   if a==2;
147       text(0,183,['time series EOF1 and EOF2 OLR ER ' df]);
148   elseif a==13;
149       text(0,183,['time series EOF1 and EOF2 OLR ER ' df]);
150   elseif a==24;
151       text(0,183,['time series EOF1 and EOF2 OLR ER ' df]);
152   end;
153   title(a+1978,'FontSize',8);
154   set (gca,'tickDir','out');
155axis([1 122 -100 100]);
156
157set (gca,'YTick',[-100:20:100],'YTickLabel',[-100:20:100],'fontname','Arial','fontsize',6);
158set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
159end;
160
161figure(1);
162fullfilename=[IRCAAM_OD,'time_serie_eof_ER_',df,'_part1.eps'];
163print('-depsc2',fullfilename);
164figure(2);
165fullfilename=[IRCAAM_OD,'time_serie_eof_ER_',df,'_part2.eps'];
166print('-depsc2',fullfilename);
167figure(3);
168fullfilename=[IRCAAM_OD,'time_serie_eof_ER_',df,'_part3.eps'];
169print('-depsc2',fullfilename);
Note: See TracBrowser for help on using the repository browser.