source: trunk/src/plotimageMSG.m @ 327

Last change on this file since 327 was 327, checked in by pinsard, 13 years ago

change svn properties

  • Property svn:keywords set to URL
File size: 5.5 KB
Line 
1function [longi,latit,imagemsg]=plotimageMSG(yyyy, mm, dd,timestep,lonmin,lonmax,latmin,latmax,product,tseuil)
2
3%+
4%
5%
6% ==============
7% plotimageMSG.m
8% ==============
9%
10% .. function:: plotimageMSG(yyyy, mm, dd,timestep,lonmin,lonmax,latmin,latmax,product,tseuil)
11%
12% DESCRIPTION
13% ===========
14%
15%   :param timestep: hour and minute
16%   :type timestep: double
17%   :raise timestep: required
18%
19%   :para mm: month of MSG data mm
20%   :type mm: double
21%   :raise mm: required
22%
23%   :para dd: day of MSG data dd
24%   :type dd: double
25%   :raise dd: required
26%
27%   :para timestep: month of MSG data timestep
28%   :type timestep: double
29%   :raise timestep: required
30%
31%   :param lonmin: longitude min, W < 0
32%   :units lonmin: deg
33%   :type lonmin: double
34%   :raise lonmin: required
35%
36%   :param lonmax: longitude max, W < 0
37%   :units lonmax: deg
38%   :type lonmax: double
39%   :raise lonmax: required
40%
41%   :param latmin: latitude min, N > 0
42%   :units latmin: deg
43%   :type latmin: double
44%   :raise latmin: required
45%
46%   :param latmax: latitude max, N > 0
47%   :units latmax: deg
48%   :type latmax: double
49%   :raise latmax: required
50%
51%   :param product: classif for classification, tb108 for temperature brillance 10.8
52%   :type product: string
53%   :raise product: required
54%
55%   :param tseuil: seuil de température de brillance
56%   :units tseuil: K
57%   :type tseuil: double
58%   :raise tseuil: required
59%
60% +todo+ lit MSG NetCDF file in :file:`${PROJECT_ID}/MSG/{yyyy}/{mm}/`.
61%
62% +todo+ calcule
63%
64% +todo+ dessine
65%
66% EXAMPLES
67% ========
68%
69% To plot temperature brillance 10.8 of MSG data on 2006-08-01 at time 00:00::
70%
71%  see demo 1
72%
73% SEE ALSO
74% ========
75%
76% :ref:`data_msg`
77%
78% :ref:`varamma_startup.m`
79%
80% :func:`MSGread`
81%
82% TODO
83% ====
84%
85% status de retour
86%
87% externalize reading (to make demo with simulation possible)
88%
89% check for missing values
90%
91% demo classif
92%
93% demo simul
94%
95% get rid of mlint output
96%
97% check arguments
98%
99% replace timestep by hhmn
100%
101% date and time dans title
102%
103% save figure
104%
105% EVOLUTIONS
106% ==========
107%
108% $Id: plotimageMSG.m 325 2011-08-04 15:30:01Z pinsard $
109%
110% $URL$
111%
112% - pinsard 2011-05-26T07:52:18Z loholt1.ipsl.polytechnique.fr
113%
114%   * image is a function (reserve word)
115%
116% - pinsard 2011-05-03T17:22:24Z loholt1.ipsl.polytechnique.fr (Linux)
117%
118%   * improve parameters
119%   * use MSGread
120%   * add demo
121%
122% - fplod 20110121T131304Z aedon.locean-ipsl.upmc.fr (Darwin)
123%
124%   * complement on header
125%
126% - fplod 20100726T123636Z aedon.locean-ipsl.upmc.fr (Darwin)
127%
128%   * files must be in ${PROJECT_ID}/MSG/yyyy/mm/
129%
130% - fplod 20100608T114448Z aedon.locean-ipsl.upmc.fr (Darwin)
131%
132%   * make it work running with matlab
133%     no more ``Value must be a column or row vector``
134%
135% - fplod 20100604T094112Z aedon.locean-ipsl.upmc.fr (Darwin)
136%
137%   * minimize mlint output
138%
139% - fplod 20100604T083004Z aedon.locean-ipsl.upmc.fr (Darwin)
140%
141%   * add usage of varamma_startup : no more chemin parameter, PROJECT_ID value
142%     used instead
143%
144% - fplod 20100525T124145Z aedon.locean-ipsl.upmc.fr (Darwin)
145%
146%   * add example
147%
148% - fplod 20100521T150917Z aedon.locean-ipsl.upmc.fr (Darwin)
149%
150%   * minimal header
151%
152% - lelod 20100521
153%
154%   * creation
155%-
156%global application;
157%global PROJECT_OD;
158%
159z_deb=[latmin lonmin];
160z_fin=[latmax lonmax];
161[data, time, lon, lat, yyyy, mm, dd] = MSGread(num2str(yyyy,'%4.4d'), num2str(mm,'%2.2d'), num2str(dd,'%2.2d'));
162%++ test si lecture ok
163
164%switch product
165%    case {'classif'}
166    %trace image
167%    la=find(lat(:)>z_deb(1) & lat(:)<z_fin(1));
168%    lo=find(lon(:)>z_deb(2) & lon(:)<z_fin(2));
169%    latit=lat(la);
170%    longi=lon(lo);
171    %trace image
172%    my_image=0.01*squeeze(data(timestep,la,lo));
173%    [x,y]=meshgrid(longi,latit);
174%    figure(1)
175%    switch application
176%       case {'matlab'}
177%          imagesc(longi,latit,my_image);
178%       case {'octave'}
179%          imagesc(x,y,my_image);
180%       otherwise
181%          error('unknown application running');
182%    end
183%    xlabel('longitude');
184%    ylabel('latitude');
185%    title('msg classif');
186%    set(gca,'Ydir','reverse');
187%    colorbar('WestOutside','YTickLabel',{'Terre claire','Mer claire','Bas cumul.','Bas non cumul.','Moyen cumul.','Moyen non cumul.','Haut cumul.','Haut non cumul.','Semi-transparent','Fractionne'},'fontsize',8);
188
189%    case {'tb108' }
190    %trace image
191    la=find(lat(:)>z_deb(1) & lat(:)<z_fin(1));
192    lo=find(lon(:)>z_deb(2) & lon(:)<z_fin(2));
193    latit=lat(la);
194    longi=lon(lo);
195    imagemsg=squeeze(data(timestep,la,lo));
196%    data_cloud=find(imagemsg < tseuil);
197%    imagefin=imagemsg(data_cloud);
198    [x,y]=meshgrid(longi,latit);
199    figure(1)
200%    switch application
201%       case {'matlab'}
202%          imagesc(longi,latit,imagemsg);
203%       case {'octave'}
204          imagesc(x,y,imagemsg);
205%       otherwise
206%          error('unknown application running');
207%    end
208    xlabel('longitude');
209    ylabel('latitude');
210    title('msg tb 108');
211    set(gca,'Ydir','reverse');
212    %colorbar('YTick',[1:1:10.5],'YTickLabel','fontsize',8);
213    colorbar('WestOutside');
214    %
215    %nb de points froids
216    'nombre de pixels de Tb < tseuil';
217    a=find(imagemsg <tseuil);
218    %pour avoir le nombre de pixels en-dessous du seuil pour une image
219    nombrepixels=size(a);
220end
221
222%!demo
223%! ! To plot temperature brillance 10.8 of MSG data on 2006-08-01 at the 1st time step::
224%! clear all
225%! varamma_startup
226%! yyyy=2006;
227%! mm=8;
228%! dd=1;
229%! timestep=1;
230%! product='tb108';
231%! tseuil=239;
232%! lonmin=-20;
233%! lonmax=-10;
234%! latmin=10;
235%! latmax=20;
236%! [longi,latit,imagemsg]=plotimageMSG(yyyy, mm, dd,timestep,lonmin,lonmax,latmin,latmax,product,tseuil);
Note: See TracBrowser for help on using the repository browser.