source: trunk/src/mode_sahelien/carte_eof_ER_jjas_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: 5.1 KB
Line 
1function carte_eof_ER_jjas_df(period1, period2)
2% carte_eof_ER_jjas_df ++explication between period1 days and period2 days
3
4%+
5%
6%  .. _carte_eof_ER_jjas_df.m:
7%
8% ======================
9% carte_eof_ER_jjas_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
23% produce a PostScript file :file:`resultats_eof_jjas_2006_10-30d.eps` and a
24% :file:`vecteurs_eof_ER10-30d.txt` file::
25%
26% >> carte_eof_ER_jjas_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:`time_serie_ER_rossby_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% clean variables and plot
51%
52% find where ``vecteurs_eof_ER??-??d30.txt`` are used
53%
54% EVOLUTIONS
55% ==========
56%
57% $Id$
58%
59% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
60%
61%   * add try/catch on opening file for reading
62%
63% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin)
64%
65%   * replace ndmin by period1 and ndmax by period2
66%
67% - fplod 2009-01-27T12:39:15Z aedon.locean-ipsl.upmc.fr (Darwin)
68%
69%   * created from carte_eof_ER_jjas_1030.m to replace it as well as
70%     carte_eof_ER_jjas_30100.m
71%
72%     Days will be now written ``period1``\-``period2d`` (ex: 10-30d) in filenames.
73%
74%-
75
76global IRCAAM_ID;
77global IRCAAM_OD;
78
79if nargin==2
80 % period1 must be lower than period2
81 if (period1 > period2)
82  disp(['period1 = ', int2str(period1)]);
83  disp(['period2 = ', int2str(period2)]);
84  error('eee : period1 must be lower than period2');
85 end
86else
87  usage='usage : carte_eof_ER_jjas_df(period1, period2)';
88  disp(usage);
89  error('eee : wrong arguments numbers')
90end
91
92% period1 and period2 will be used in xx-yyd form in filenames
93df = [int2str(period1),'-',int2str(period2),'d'];
94clear period1;
95clear period2;
96
97fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat'];
98try
99 status=load(fullfilename,'C','L');
100catch
101 error('eee : File %s not found\n', fullfilename);
102end
103
104clear fullfilename;
105
106C=status.C;
107L=status.L;
108clear status;
109
110carte1=C(:,425);
111
112carte=reshape(carte1,25,17);
113carte=carte';
114
115clear carte1;
116% defintion des lat et lon
117lon=[-30:2.5:30]';
118lat=[-10:2.5:30];
119
120figure(1);
121orient('landscape');
122subplot(3,2,1);
123palette;
124for a=1:17;
125    for b=1:25;
126        if carte(a,b)>0.2;
127            carte(a,b)=0.2;
128        elseif carte(a,b)<-0.2;
129            carte(a,b)=-0.2;
130        end;
131    end;
132end;
133carte(1,1)=-0.2001;
134carte(1,2)=0.2001;
135
136contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none');
137colorbar;
138title('OLR EOF1','Fontsize',8);
139hold on;
140cartemonde;
141set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
142set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
143set (gca,'tickDir','out');
144
145clear carte1 x y a b carte coco;
146carte1=C(:,424);
147carte=reshape(carte1,25,17);
148carte=carte';
149
150clear carte1;
151lon=[-30:2.5:30]';
152lat=[-10:2.5:30];
153
154subplot(3,2,3);
155palette;
156for a=1:17;
157    for b=1:25;
158        if carte(a,b)>0.2;
159            carte(a,b)=0.2;
160        elseif carte(a,b)<-0.2;
161            carte(a,b)=-0.2;
162        end;
163    end;
164end;
165carte(1,1)=-0.2001;
166carte(1,2)=0.2001;
167
168contourf(lon,lat,carte,[-0.2:0.02:0.2],'LineStyle','none');
169colorbar;
170
171title('OLR EOF2','Fontsize',8);
172hold on;
173cartemonde;
174set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
175set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
176set (gca,'tickDir','out');
177
178clear carte1 x y a b carte coco;
179carte1=C(:,423);
180carte=reshape(carte1,25,17);
181carte=carte';
182clear carte1;
183
184% defintion des lat et lon
185lon=[-30:2.5:30]';
186lat=[-10:2.5:30];
187
188subplot(3,2,5);
189palette;
190for a=1:17;
191    for b=1:25;
192        if carte(a,b)>0.2;
193            carte(a,b)=0.2;
194        elseif carte(a,b)<-0.2;
195            carte(a,b)=-0.2;
196        end;
197    end;
198end;
199carte(1,1)=-0.2001;
200carte(1,2)=0.2001;
201
202contourf(lon,lat,-carte,[-0.2:0.02:0.2],'LineStyle','none');
203colorbar;
204title('OLR EOF3','Fontsize',8);
205hold on;
206cartemonde;
207set (gca,'YTick',[-10:10:30],'YTickLabel',['10S';'  0';'10N';'20N';'30N'],'fontname','Arial','fontsize',6);
208set (gca,'XTick',[-30:10:30],'XTickLabel',['30W';'20W';'10W';'  0';'10E';'20E';'30E'],'fontname','Arial','fontsize',6);
209set (gca,'tickDir','out');
210
211subplot(3,2,2);
212vaude=0;
213for a=1:425;
214   vaude=vaude+L(a,a);
215end;
216vecteurs=zeros(20,1);
217for a=1:20;
218   b=425-(a-1);
219   vecteurs(a)=100*(L(b,b)/vaude);
220end;
221x=[1:20]';
222
223bar(x,vecteurs,'LineStyle','none')
224
225fullfilename=[IRCAAM_OD,'vecteurs_eof_ER',df,'.txt'];
226save(fullfilename,'vecteurs','-ASCII');
227clear fullfilename;
228
229axis([0.5 20.5 0 25]);
230set (gca,'YTick',[0:5:25],'YTickLabel',[0:5:25],'fontname','Arial','fontsize',6);
231set (gca,'XTick',[2:2:20],'XTickLabel',[2:2:20],'fontname','Arial','fontsize',6);
232set (gca,'tickDir','out');
233
234fullfilename=[IRCAAM_OD,'resultats_eof_jjas_2006_',df,'.eps'];
235print('-depsc2',fullfilename);
236clear fullfilename;
Note: See TracBrowser for help on using the repository browser.