source: trunk/src/mode_sahelien/time_serie_ER_rossby_df.m @ 91

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

fix some links in manuals

File size: 3.3 KB
Line 
1function time_serie_ER_rossby_df(period1, period2)
2% time_serie_ER_rossby_df ++explication between period1 days and period2 days
3
4%+
5%
6%  .. _time_serie_ER_rossby_df.m:
7%
8% =========================
9% time_serie_ER_rossby_df.m
10% =========================
11%
12% ++
13%
14% DESCRIPTION
15% ===========
16%
17% plot ++ from file :file:`eof_rossby_jjas_2006_10-30d.mat`
18%
19% EXAMPLES
20% ========
21%
22% Following line read :file:`eof_rossby_jjas_2006_10-30d.mat`, plot ++and produce  :file:`table_ER_10-30d.txt` file
23%
24% ::
25%
26% >> time_serie_ER_rossby_df(10,30);
27%
28% SEE ALSO
29% ========
30%
31% :ref:`olr_eof_jjas2006_rossby_df.m`
32%
33% :ref:`carte_eof_ER_1030_article.m`
34%
35% :ref:`carte_eof_ER_jjas_df.m`
36%
37% :ref:`time_serie_ER_rossby_df_complet.m`
38%
39% :ref:`reconstitution_ER_rossby_df.m`
40%
41% TODO
42% ====
43%
44% improve description
45%
46% improve file pb
47%
48% use return function
49%
50% find where ``table_ER_??-??d.txt`` are used
51%
52% EVOLUTIONS
53% ==========
54%
55% $Id$
56%
57% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
58%
59%   * add try/catch on opening file for reading
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-27T10:07:29Z aedon.locean-ipsl.upmc.fr (Darwin)
66%
67%   * created from time_serie_ER_rossby_1030.m to replace it as well as
68%     time_serie_ER_rossby_30100.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_ER_rossby_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_rossby_jjas_2006_',df,'.mat'];
96try
97 status=load(fullfilename,'C','olr');
98catch
99 error('eee : File %s not found\n', fullfilename);
100end
101
102clear fullfilename;
103C=status.C;
104olr=status.olr;
105clear status;
106
107olr=olr';
108PC1=olr*C;
109
110time_serie_olr1=PC1(:,425);
111time_serie_olr2=PC1(:,424);
112year=zeros(122,28);
113for a=1:122
114    for b=1:28;
115       year(a,b)=1979+(b-1);
116    end;
117end;
118year=reshape(year,3416,1);
119
120day=zeros(122,28);
121for a=1:122
122    for b=1:28;
123       day(a,b)=31+28+31+30+31+a;
124    end;
125end;
126day=reshape(day,3416,1);
127
128table_ER=zeros(3416,4);
129for a=1:3416;
130     for b=1:4;
131        table_ER(a,1)=year(a);
132        table_ER(a,2)=day(a);
133        table_ER(a,3)=time_serie_olr1(a);
134        table_ER(a,4)=time_serie_olr2(a);
135     end;
136end;
137
138fullfilename=[IRCAAM_OD,'table_ER_',df,'.txt'];
139save(fullfilename,'table_ER','-ASCII');
140clear fullfilename;
141
142a=1;
143clear koro1
144debut=(a-1)*122+1;
145fin=a*122;
146koro1=time_serie_olr1(debut:fin);
147koro2=time_serie_olr2(debut:fin);
148x=[1:122]';
149aa=plot(x,-koro1,'r');
150hold on;
151bb=plot(x,-koro2,'k');
152cc=legend('EOF1','EOF2');
153set (cc,'fontsize',6);
154legend boxoff
155y=zeros(122,1);
156plot(x,y,'k:');
157
158set (gca,'tickDir','out');
159axis([1 122 -100 100]);
160
161set (gca,'YTick',[-100:20:100],'YTickLabel',[-100:20:100],'fontname','Arial','fontsize',6);
162set (gca,'XTick',[0:20:120],'XTickLabel',[0:20:120],'fontname','Arial','fontsize',6);
Note: See TracBrowser for help on using the repository browser.