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

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

parametrisation of time_serie_jjas_....m and composite_olr_EOF1....m

File size: 3.9 KB
Line 
1function time_serie_jjas_df(ndmin, ndmax)
2% time_serie_jjas_df ++explication between ndmin days and ndmax days
3
4%+
5% module
6% ======
7%
8% ++
9%
10% DESCRIPTION
11% ===========
12%
13% From eof_\ *ndmin*\ -\ *ndmax*\ 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]\ *ndmin*\ -\ *ndmax*\ d.txt.
19%
20% 2 Postscript files
21% time_serie_jjas_\ *ndmin*\ -\ *ndmax*\ 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-01-28T15:28:54Z aedon.locean-ipsl.upmc.fr (Darwin)
62%
63%   * created from time_serie_jjas_30100.m to replace it as well as
64%     time_serie_jjas.m, time_serie_jjas_25_90.m and time_serie_jjas_10_25.m
65%
66%     Days will be now written ``ndmin``\-``ndmaxd`` (ex: 10-30d) in filenames.
67%
68%-
69
70global IRCAAM_ID;
71global IRCAAM_OD;
72
73if nargin==2
74 % ndmin must be lower than ndmax
75 if (ndmin > ndmax)
76  disp(['ndmin = ', int2str(ndmin)]);
77  disp(['ndmax = ', int2str(ndmax)]);
78  error('eee : ndmin must be lower than ndmax');
79 end
80else
81  usage='usage : time_serie_jjas_df(ndmin, ndmax)';
82  disp(usage);
83  error('eee : wrong arguments numbers')
84end
85
86% ndmin and ndmax will be used in xx-yyd form in filenames
87df = [int2str(ndmin),'-',int2str(ndmax),'d'];
88clear ndmin;
89clear ndmax;
90
91fullfilename=[IRCAAM_ID,'eof_', df, '_jjas.mat'];
92status=load(fullfilename);
93clear fullfilename;
94C=status.C;
95olr=status.olr;
96clear status;
97
98olr=olr';
99PC1=olr*C;
100
101%%%%%%% cronique de la VP1
102time_serie_olr1=PC1(:,425);
103time_serie_olr2=PC1(:,424);
104time_serie_olr3=PC1(:,423);
105
106dt_olr1=std(time_serie_olr1);
107dt_olr2=std(time_serie_olr2);
108dt_olr3=std(time_serie_olr3);
109
110for a=1:3416;
111   time_serie_olr1(a)=time_serie_olr1(a)/dt_olr1;
112   time_serie_olr2(a)=time_serie_olr2(a)/dt_olr2;
113   time_serie_olr3(a)=time_serie_olr3(a)/dt_olr3;
114end;
115
116fullfilename=[IRCAAM_ID,'eof1_',df,'.txt'];
117save(fullfilename,'time_serie_olr1','-ASCII');
118clear fullfilename;
119
120fullfilename=[IRCAAM_ID,'eof2_',df,'.txt'];
121save(fullfilename,'time_serie_olr2','-ASCII');
122clear fullfilename;
123
124fullfilename=[IRCAAM_ID,'eof3_',df,'.txt'];
125save(fullfilename,'time_serie_olr3','-ASCII');
126clear fullfilename;
127
128x=[1:3416]';
129for a=1:22;
130   if a<12;
131      figure(1);
132      subplot(4,3,a);
133   elseif a<23;
134      figure(2);
135      subplot(4,3,a-11);
136   else
137      figure(3);
138      subplot(4,3,a-22);
139   end;
140   clear koro1;
141   debut=(a-1)*122+1;
142   fin=a*122;
143   koro1=time_serie_olr1(debut:fin);
144
145   clear x;
146   x=[1:122]';
147   plot(x,koro1,'r');
148   hold on
149   y=zeros(122,1);
150   plot(x,y,'k:');
151   title(a+1978,'FontSize',8);
152   my_title=['serie temporelle VP1 filtrage ', df];
153   if a==2;
154       text(0,5.5,my_title);
155   elseif a==13;
156       text(0,5.5,my_title);
157   elseif a==24;
158       text(0,5.5,my_title);
159   end;
160   set (gca,'tickDir','out');
161   axis([1 122 -3 3]);
162
163   set (gca,'YTick',[-3:1:3],'YTickLabel',[-3:1:3],'fontname','Arial','fontsize',6);
164   set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
165end;
166
167figure(1);
168fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part1.eps'];
169print('-depsc2',fullfilename);
170clear fullfilename;
171figure(2);
172fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part2.eps'];
173print('-depsc2',fullfilename);
174clear fullfilename;
175figure(3);
176fullfilename=[IRCAAM_OD,'time_serie_jjas_', df, '_part3.eps'];
177print('-depsc2',fullfilename);
178clear fullfilename;
Note: See TracBrowser for help on using the repository browser.