source: trunk/src/mode_sahelien/time_serie_jjas_df.m @ 56

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

replace ndmin by period1 and ndmax by period2

File size: 4.1 KB
Line 
1function time_serie_jjas_df(period1, period2)
2% time_serie_jjas_df ++explication between period1 days and period2 days
3
4%+
5% module
6% ======
7%
8% ++
9%
10% DESCRIPTION
11% ===========
12%
13% From eof_\ *period1*\ -\ *period2*\ d_jjas.mat,
14% ``time_serie_jjas_df`` compute ++.
15%
16% ``time_serie_jjas_df`` plot ++.
17%
18% ``time_serie_jjas_df`` save eof[123]\ *period1*\ -\ *period2*\ d.txt.
19%
20% 2 Postscript files
21% time_serie_jjas_\ *period1*\ -\ *period2*\ d_part[12].eps are
22% written.
23%
24% EXAMPLES
25% ========
26%
27% Following line read ``eof_10-30d_jjas.mat``,
28% compute ++,
29% plot ++,
30% write ``eof[123]_10-30d.txt`` and
31% write ``time_serie_jjas_eof1_10-30d_part[12].eps``
32% ::
33%
34% >> time_serie_jjas_df(10,30);
35%
36% SEE ALSO
37% ========
38%
39% composite_olr_eof_df_
40%
41% .. _composite_olr_eof_df : composite_olr_eof_df.html
42%
43% TODO
44% ====
45%
46% improve description
47%
48% improve file pb
49%
50% use return function
51%
52% nb of figure depends on number of years to be plot : so figure(3) contains
53% something only if nb years > 23 (or so), so Postscript file of figure(3)
54% shoul not be saved if  nb years is less than 23 !
55%
56% EVOLUTIONS
57% ==========
58%
59% $Id$
60%
61% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin)
62%
63%   * replace ndmin by period1 and ndmax by period2
64%
65% - fplod 2009-01-28T15:28:54Z aedon.locean-ipsl.upmc.fr (Darwin)
66%
67%   * created from time_serie_jjas_30100.m to replace it as well as
68%     time_serie_jjas.m, time_serie_jjas_25_90.m and time_serie_jjas_10_25.m
69%
70%     Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames.
71%
72%-
73
74global IRCAAM_ID;
75global IRCAAM_OD;
76
77if nargin==2
78 % period1 must be lower than period2
79 if (period1 > period2)
80  disp(['period1 = ', int2str(period1)]);
81  disp(['period2 = ', int2str(period2)]);
82  error('eee : period1 must be lower than period2');
83 end
84else
85  usage='usage : time_serie_jjas_df(period1, period2)';
86  disp(usage);
87  error('eee : wrong arguments numbers')
88end
89
90% period1 and period2 will be used in xx-yyd form in filenames
91df = [int2str(period1),'-',int2str(period2),'d'];
92clear period1;
93clear period2;
94
95fullfilename=[IRCAAM_ID,'eof_', df, '_jjas.mat'];
96status=load(fullfilename);
97clear fullfilename;
98C=status.C;
99olr=status.olr;
100clear status;
101
102olr=olr';
103PC1=olr*C;
104
105%%%%%%% cronique de la VP1
106time_serie_olr1=PC1(:,425);
107time_serie_olr2=PC1(:,424);
108time_serie_olr3=PC1(:,423);
109
110dt_olr1=std(time_serie_olr1);
111dt_olr2=std(time_serie_olr2);
112dt_olr3=std(time_serie_olr3);
113
114for a=1:3416;
115   time_serie_olr1(a)=time_serie_olr1(a)/dt_olr1;
116   time_serie_olr2(a)=time_serie_olr2(a)/dt_olr2;
117   time_serie_olr3(a)=time_serie_olr3(a)/dt_olr3;
118end;
119
120fullfilename=[IRCAAM_ID,'eof1_',df,'.txt'];
121save(fullfilename,'time_serie_olr1','-ASCII');
122clear fullfilename;
123
124fullfilename=[IRCAAM_ID,'eof2_',df,'.txt'];
125save(fullfilename,'time_serie_olr2','-ASCII');
126clear fullfilename;
127
128fullfilename=[IRCAAM_ID,'eof3_',df,'.txt'];
129save(fullfilename,'time_serie_olr3','-ASCII');
130clear fullfilename;
131
132x=[1:3416]';
133for a=1:22;
134   if a<12;
135      figure(1);
136      subplot(4,3,a);
137   elseif a<23;
138      figure(2);
139      subplot(4,3,a-11);
140   else
141      figure(3);
142      subplot(4,3,a-22);
143   end;
144   clear koro1;
145   debut=(a-1)*122+1;
146   fin=a*122;
147   koro1=time_serie_olr1(debut:fin);
148
149   clear x;
150   x=[1:122]';
151   plot(x,koro1,'r');
152   hold on
153   y=zeros(122,1);
154   plot(x,y,'k:');
155   title(a+1978,'FontSize',8);
156   my_title=['serie temporelle VP1 filtrage ', df];
157   if a==2;
158       text(0,5.5,my_title);
159   elseif a==13;
160       text(0,5.5,my_title);
161   elseif a==24;
162       text(0,5.5,my_title);
163   end;
164   set (gca,'tickDir','out');
165   axis([1 122 -3 3]);
166
167   set (gca,'YTick',[-3:1:3],'YTickLabel',[-3:1:3],'fontname','Arial','fontsize',6);
168   set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
169end;
170
171figure(1);
172fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part1.eps'];
173print('-depsc2',fullfilename);
174clear fullfilename;
175figure(2);
176fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part2.eps'];
177print('-depsc2',fullfilename);
178clear fullfilename;
179figure(3);
180fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part3.eps'];
181print('-depsc2',fullfilename);
182clear fullfilename;
Note: See TracBrowser for help on using the repository browser.