1 | function [longi,latit,amsutot]=scatterplot(nosat, mois,jour,heure,lonmin,lonmax,latmin,latmax) |
---|
2 | |
---|
3 | %SCATTERPLOT +todo+ |
---|
4 | %+ |
---|
5 | % |
---|
6 | % ============= |
---|
7 | % scatterplot.m |
---|
8 | % ============= |
---|
9 | % |
---|
10 | % .. function:: scatterplot(mois,jour,heure,lonmin,lonmax,latmin,latmax) |
---|
11 | % |
---|
12 | % DESCRIPTION |
---|
13 | % =========== |
---|
14 | % |
---|
15 | % :param mois: mois |
---|
16 | % :type mois: array of int8 |
---|
17 | % :raise mois: required |
---|
18 | % |
---|
19 | % :param jour: jour debut |
---|
20 | % :type jour: array of int8 |
---|
21 | % :raise jour: required |
---|
22 | % |
---|
23 | % :param heure: heure ++ amsu |
---|
24 | % :type heure: int8 |
---|
25 | % :raise heure: required |
---|
26 | % |
---|
27 | % :param lonmin: longitude min, W < 0 |
---|
28 | % :units lonmin: deg |
---|
29 | % :type lonmin: double |
---|
30 | % :raise lonmin: required |
---|
31 | % |
---|
32 | % :param lonmax: longitude max, W < 0 |
---|
33 | % :units lonmax: deg |
---|
34 | % :type lonmax: double |
---|
35 | % :raise lonmax: required |
---|
36 | % |
---|
37 | % :param latmin: latitude min, N > 0 |
---|
38 | % :units latmin: deg |
---|
39 | % :type latmin: double |
---|
40 | % :raise latmin: required |
---|
41 | % |
---|
42 | % :param latmax: latitude max, N > 0 |
---|
43 | % :units latmax: deg |
---|
44 | % :type latmax: double |
---|
45 | % :raise latmax: required |
---|
46 | % |
---|
47 | % tentative de cumul de quelques fichiers AMSU et MSG pour traces |
---|
48 | % histogrammes et diagramme de dispersion |
---|
49 | % |
---|
50 | % +todo+ lit |
---|
51 | % |
---|
52 | % +todo+ calcule |
---|
53 | % |
---|
54 | % +todo+ dessine |
---|
55 | % |
---|
56 | % EXAMPLES |
---|
57 | % ======== |
---|
58 | % |
---|
59 | % To plot +todo+:: |
---|
60 | % |
---|
61 | % octave> clear all |
---|
62 | % octave> varamma_startup |
---|
63 | % octave> mois=[8 8 8 8 8 8]; |
---|
64 | % octave> jour=[7 18 31 25 22 02]; |
---|
65 | % octave> heure=[191517 181344 80216 184655 181839 175432]; |
---|
66 | % octave> lonmin=-20; |
---|
67 | % octave> lonmax=-10; |
---|
68 | % octave> latmin=10; |
---|
69 | % octave> latmax=20; |
---|
70 | % octave> [longi,latit,amsutot]=scatterplot(mois,jour,heure,lonmin,lonmax,latmin,latmax); |
---|
71 | % |
---|
72 | % SEE ALSO |
---|
73 | % ======== |
---|
74 | % |
---|
75 | % :ref:`guide data MSG <data_msg>` |
---|
76 | % :ref:`guide data AMSU <data_amsu>` |
---|
77 | % |
---|
78 | % :ref:`varamma_startup.m` |
---|
79 | % |
---|
80 | % TODO |
---|
81 | % ==== |
---|
82 | % |
---|
83 | % get rid of mlint output |
---|
84 | % |
---|
85 | % yyyy arg |
---|
86 | % |
---|
87 | % |
---|
88 | % status de retour |
---|
89 | % |
---|
90 | % split reading and calculate and plot |
---|
91 | % |
---|
92 | % check argument |
---|
93 | % |
---|
94 | % EVOLUTIONS |
---|
95 | % ========== |
---|
96 | % |
---|
97 | % $Id$ |
---|
98 | % |
---|
99 | % $URL$ |
---|
100 | % |
---|
101 | % - fplod 20110121T140728Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
102 | % |
---|
103 | % * complement on header |
---|
104 | % |
---|
105 | % - fplod 20100901T150719Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
106 | % |
---|
107 | % * restore distinction between ASMU and MSG directories |
---|
108 | % * replace int2str by num2str to be able to specify a format |
---|
109 | % * revision of indentation |
---|
110 | % |
---|
111 | % - fplod 20100604T092417Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
112 | % |
---|
113 | % * correction for running with matlab |
---|
114 | % * minimize mlint output |
---|
115 | % |
---|
116 | % - fplod 20100604T083004Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
117 | % |
---|
118 | % * add usage of varamma_startup : no more chemin parameter, PROJECT_ID value |
---|
119 | % used instead |
---|
120 | % * no more distinction between ASMU and MSG directories : each file is |
---|
121 | % intended to be in PROJECT_ID (links are welcome !) |
---|
122 | % |
---|
123 | % - fplod 20100521T150917Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
124 | % |
---|
125 | % * minimal header |
---|
126 | % |
---|
127 | % - lelod 20100521 |
---|
128 | % |
---|
129 | % * creation |
---|
130 | %- |
---|
131 | |
---|
132 | global PROJECT_ID; |
---|
133 | global PROJECT_OD; |
---|
134 | |
---|
135 | nbfic=size(jour(:),1); |
---|
136 | numheure=fix(heure(:)/10000.); |
---|
137 | minute=fix((heure(:)-numheure(:)*10000)/100)/4; |
---|
138 | quart=minute(:)/4; |
---|
139 | ih=fix(4*numheure(:)+1+quart(:)); |
---|
140 | |
---|
141 | % AMSU |
---|
142 | z_deb=[latmin lonmin]; |
---|
143 | z_fin=[latmax lonmax]; |
---|
144 | amsutot=[]; |
---|
145 | yyyy=2006; |
---|
146 | for i=1:nbfic |
---|
147 | mo=num2str(mois(i),'%2.2d'); |
---|
148 | jo=num2str(jour(i),'%2.2d'); |
---|
149 | he=num2str(heure(i),'%6.6d'); |
---|
150 | sat=num2str(nosat(i),'%2.2d'); |
---|
151 | file=['extracted-amsubch5-noaa',sat,'_', num2str(yyyy,'%4.4d'), mo, jo,'-',he,'_afratl_Nadir.nc']; |
---|
152 | % file=[PROJECT_ID,'AMSU/2006/tmp/', num2str(yyyy,'%4.4d'), '/', |
---|
153 | % mo, '/', file]; |
---|
154 | file=[PROJECT_ID,'AMSU/tmp/', file]; |
---|
155 | |
---|
156 | file=netcdf(file,'nowrite'); |
---|
157 | time=file{'time'}; |
---|
158 | lon=file{'lon'}; |
---|
159 | lat=file{'lat'}; |
---|
160 | tbamsu=file{'tbch5b'}; |
---|
161 | mask=file{'mask'}; |
---|
162 | la=find(lat(:)>z_deb(1) & lat(:)<z_fin(1)); |
---|
163 | lo=find(lon(:)>z_deb(2) & lon(:)<z_fin(2)); |
---|
164 | latit=lat(la); |
---|
165 | longi=lon(lo); |
---|
166 | tbzone=squeeze(tbamsu(1,la,lo)); |
---|
167 | tbzone(find(tbzone == -999)) = NaN; |
---|
168 | if i==1 |
---|
169 | amsutot=tbzone; |
---|
170 | end |
---|
171 | if i>=2 |
---|
172 | amsutot=[amsutot;tbzone]; |
---|
173 | end |
---|
174 | end |
---|
175 | |
---|
176 | % MSG |
---|
177 | msgtot=[]; |
---|
178 | for i=1:nbfic |
---|
179 | mo=num2str(mois(i),'%2.2d'); |
---|
180 | jo=num2str(jour(i),'%2.2d'); |
---|
181 | date=[num2str(yyyy,'%4.4d'),'-',mo,'-',jo]; |
---|
182 | file=['extracted-msg-tb108_',date,'_15min.nc']; |
---|
183 | file=[PROJECT_ID,'MSG/', num2str(yyyy,'%4.4d'), '/', mo, '/', file]; |
---|
184 | file=netcdf(file,'nowrite'); |
---|
185 | tbmsg=file{'DATA'}; |
---|
186 | lon=file{'LONGITUDE'}; |
---|
187 | lat=file{'LATITUDE'}; |
---|
188 | time=file{'TIME'}; |
---|
189 | la=find(lat(:)>z_deb(1) & lat(:)<z_fin(1)); |
---|
190 | lo=find(lon(:)>z_deb(2) & lon(:)<z_fin(2)); |
---|
191 | latit=lat(la); |
---|
192 | longi=lon(lo); |
---|
193 | hh=ih(i); |
---|
194 | tbzon=0.01*squeeze(tbmsg(hh,la,lo))+327.68; |
---|
195 | if i==1 |
---|
196 | msgtot=tbzon; |
---|
197 | end |
---|
198 | if i>=2 |
---|
199 | msgtot=[msgtot;tbzon]; |
---|
200 | end |
---|
201 | end |
---|
202 | |
---|
203 | |
---|
204 | %trace histogrammes |
---|
205 | figure(2) |
---|
206 | Tseuil1=280; % on enleve les points chauds (surface) |
---|
207 | a=find(msgtot <Tseuil1); |
---|
208 | hist(msgtot(a)) |
---|
209 | xlabel('TbMSG'); |
---|
210 | figure(3) |
---|
211 | Tseuil2=250; % on enleve les points chauds (surface) |
---|
212 | a=find(amsutot <Tseuil2); |
---|
213 | hist(amsutot(a)) |
---|
214 | xlabel('TbAMSU'); |
---|
215 | |
---|
216 | %trace diagramme de dispersion tbamsu vs tbmsg |
---|
217 | figure(1) |
---|
218 | a=find((msgtot <Tseuil1) & (amsutot <Tseuil2)); |
---|
219 | %scatter(amsutot(a),msgtot(a), "+") |
---|
220 | plot(amsutot(a),msgtot(a), '+', 'markersize', 1); |
---|
221 | xlabel('TbAMSU'); |
---|
222 | ylabel('TbMSG'); |
---|
223 | |
---|