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

Last change on this file since 82 was 82, checked in by pinsard, 14 years ago

modif. of headers for manuals hyperlinks improvements

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