1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | import string |
---|
4 | import numpy as np |
---|
5 | import matplotlib.pyplot as plt |
---|
6 | from pylab import * |
---|
7 | from mpl_toolkits.basemap import Basemap |
---|
8 | from mpl_toolkits.basemap import shiftgrid, cm |
---|
9 | from netCDF4 import Dataset |
---|
10 | import ffgrid2 |
---|
11 | |
---|
12 | |
---|
13 | len_month = np.array([31, 28, 31, 30, 31, 30, 31]) |
---|
14 | month = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) |
---|
15 | chan = np.array(['CH1', 'CH15']) |
---|
16 | ################ |
---|
17 | # CARTOGRAPHIE # |
---|
18 | ################ |
---|
19 | ## Etude sur l'Antarctique ## |
---|
20 | dx = 5. |
---|
21 | dy = 5. |
---|
22 | x0, x1 = -180, 180 |
---|
23 | y0, y1 = -90, -30 |
---|
24 | |
---|
25 | |
---|
26 | ## JANUARY ## |
---|
27 | imo = 0 |
---|
28 | ## ch1 ## |
---|
29 | fovZen_ch1_JAN = np.where(fov1_JAN == 21.) |
---|
30 | bbemis_ch1_JAN = nonzero((emis1_JAN[fovZen_ch1_JAN] != -500.) & (emis1_JAN[fovZen_ch1_JAN] <= 1.)) |
---|
31 | OUTZCH1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
32 | outzch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
33 | lonch1_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
34 | latch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
35 | ## ch15 ## |
---|
36 | fovZen_ch15_JAN = np.where(fov15_JAN == 21.) |
---|
37 | bbemis_ch15_JAN = nonzero((emis15_JAN[fovZen_ch15_JAN] != -500.) & (emis15_JAN[fovZen_ch15_JAN] <= 1.)) |
---|
38 | OUTZCH15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
39 | outzch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
40 | lonch15_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
41 | latch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
42 | for ijr in range (0, len_month[imo]): |
---|
43 | print 'jour=', ijr+1 |
---|
44 | ## ch1 ## |
---|
45 | ind_jr1_JAN = np.where(jjr1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN] == ijr+1)[0] |
---|
46 | xx = lon1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] |
---|
47 | yy = lat1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] |
---|
48 | zz = emis1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] |
---|
49 | zz0 = min(zz) |
---|
50 | zz1 = max(zz) |
---|
51 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
52 | outzch1_JAN = outz |
---|
53 | lonch1_JAN = outx |
---|
54 | latch1_JAN = outy |
---|
55 | OUTZCH1_JAN[:,:,ijr] = outzch1_JAN[:,:] |
---|
56 | ## ch15 ## |
---|
57 | ind_jr15_JAN = np.where(jjr15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN] == ijr+1)[0] |
---|
58 | xx = lon15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] |
---|
59 | yy = lat15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] |
---|
60 | zz = emis15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] |
---|
61 | zz0 = min(zz) |
---|
62 | zz1 = max(zz) |
---|
63 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
64 | outzch15_JAN = outz |
---|
65 | lonch15_JAN = outx |
---|
66 | latch15_JAN = outy |
---|
67 | OUTZCH15_JAN[:,:,ijr] = outzch15_JAN[:,:] |
---|
68 | |
---|
69 | OUTZ_JAN = np.array([OUTZCH1_JAN, OUTZCH15_JAN]) |
---|
70 | |
---|
71 | |
---|
72 | ## FEBRUARY ## |
---|
73 | imo = 1 |
---|
74 | ## ch1 ## |
---|
75 | fovZen_ch1_FEB = np.where(fov1_FEB == 21.) |
---|
76 | bbemis_ch1_FEB = nonzero((emis1_FEB[fovZen_ch1_FEB] != -500.) & (emis1_FEB[fovZen_ch1_FEB] <= 1.)) |
---|
77 | OUTZCH1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
78 | outzch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
79 | lonch1_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
80 | latch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
81 | ## ch15 ## |
---|
82 | fovZen_ch15_FEB = np.where(fov15_FEB == 21.) |
---|
83 | bbemis_ch15_FEB = nonzero((emis15_FEB[fovZen_ch15_FEB] != -500.) & (emis15_FEB[fovZen_ch15_FEB] <= 1.)) |
---|
84 | OUTZCH15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
85 | outzch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
86 | lonch15_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
87 | latch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
88 | for ijr in range (0, len_month[imo]): |
---|
89 | print 'jour=', ijr+1 |
---|
90 | ## ch1 ## |
---|
91 | ind_jr1_FEB = np.where(jjr1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB] == ijr+1)[0] |
---|
92 | shape(ind_jr1_FEB) |
---|
93 | xx = lon1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB] |
---|
94 | yy = lat1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB] |
---|
95 | zz = emis1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB] |
---|
96 | zz0 = min(zz) |
---|
97 | zz1 = max(zz) |
---|
98 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
99 | outzch1_FEB = outz |
---|
100 | lonch1_FEB = outx |
---|
101 | latch1_FEB = outy |
---|
102 | OUTZCH1_FEB[:,:,ijr] = outzch1_FEB[:,:] |
---|
103 | ## ch15 ## |
---|
104 | ind_jr15_FEB = np.where(jjr15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB] == ijr+1)[0] |
---|
105 | shape(ind_jr15_FEB) |
---|
106 | xx = lon15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB] |
---|
107 | yy = lat15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB] |
---|
108 | zz = emis15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB] |
---|
109 | zz0 = min(zz) |
---|
110 | zz1 = max(zz) |
---|
111 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
112 | outzch15_FEB = outz |
---|
113 | lonch15_FEB = outx |
---|
114 | latch15_FEB = outy |
---|
115 | OUTZCH15_FEB[:,:,ijr] = outzch15_FEB[:,:] |
---|
116 | |
---|
117 | OUTZ_FEB = np.array([OUTZCH1_FEB, OUTZCH15_FEB]) |
---|
118 | |
---|
119 | ## MARCH ## |
---|
120 | imo = 2 |
---|
121 | ## ch1 ## |
---|
122 | fovZen_ch1_MAR = np.where(fov1_MAR == 21.) |
---|
123 | bbemis_ch1_MAR = nonzero((emis1_MAR[fovZen_ch1_MAR] != -500.) & (emis1_MAR[fovZen_ch1_MAR] <= 1.)) |
---|
124 | OUTZCH1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
125 | outzch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
126 | lonch1_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
127 | latch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
128 | ## ch15 ## |
---|
129 | fovZen_ch15_MAR = np.where(fov15_MAR == 21.) |
---|
130 | bbemis_ch15_MAR = nonzero((emis15_MAR[fovZen_ch15_MAR] != -500.) & (emis15_MAR[fovZen_ch15_MAR] <= 1.)) |
---|
131 | OUTZCH15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
132 | outzch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
133 | lonch15_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
134 | latch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
135 | for ijr in range (0, len_month[imo]): |
---|
136 | print 'jour=', ijr+1 |
---|
137 | ## ch1 ## |
---|
138 | ind_jr1_MAR = np.where(jjr1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR] == ijr+1)[0] |
---|
139 | xx = lon1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] |
---|
140 | yy = lat1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] |
---|
141 | zz = emis1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] |
---|
142 | zz0 = min(zz) |
---|
143 | zz1 = max(zz) |
---|
144 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
145 | outzch1_MAR = outz |
---|
146 | lonch1_MAR = outx |
---|
147 | latch1_MAR = outy |
---|
148 | OUTZCH1_MAR[:,:,ijr] = outzch1_MAR[:,:] |
---|
149 | ## ch15 ## |
---|
150 | ind_jr15_MAR = np.where(jjr15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR] == ijr+1)[0] |
---|
151 | xx = lon15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] |
---|
152 | yy = lat15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] |
---|
153 | zz = emis15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] |
---|
154 | zz0 = min(zz) |
---|
155 | zz1 = max(zz) |
---|
156 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
157 | outzch15_MAR = outz |
---|
158 | lonch15_MAR = outx |
---|
159 | latch15_MAR = outy |
---|
160 | OUTZCH15_MAR[:,:,ijr] = outzch15_MAR[:,:] |
---|
161 | |
---|
162 | OUTZ_MAR = np.array([OUTZCH1_MAR, OUTZCH15_MAR]) |
---|
163 | |
---|
164 | |
---|
165 | ## APRIL ## |
---|
166 | imo = 3 |
---|
167 | ## ch1 ## |
---|
168 | fovZen_ch1_APR = np.where(fov1_APR == 21.) |
---|
169 | bbemis_ch1_APR = nonzero((emis1_APR[fovZen_ch1_APR] != -500.) & (emis1_APR[fovZen_ch1_APR] <= 1.)) |
---|
170 | OUTZCH1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
171 | outzch1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
172 | lonch1_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
173 | latch1_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
174 | ## ch15 ## |
---|
175 | fovZen_ch15_APR = np.where(fov15_APR == 21.) |
---|
176 | bbemis_ch15_APR = nonzero((emis15_APR[fovZen_ch15_APR] != -500.) & (emis15_APR[fovZen_ch15_APR] <= 1.)) |
---|
177 | OUTZCH15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
178 | outzch15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
179 | lonch15_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
180 | latch15_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
181 | for ijr in range (0, len_month[imo]): |
---|
182 | print 'jour=', ijr+1 |
---|
183 | ## ch1 ## |
---|
184 | ind_jr1_APR = np.where(jjr1_APR[fovZen_ch1_APR][bbemis_ch1_APR] == ijr+1)[0] |
---|
185 | shape(ind_jr1_APR) |
---|
186 | xx = lon1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR] |
---|
187 | yy = lat1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR] |
---|
188 | zz = emis1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR] |
---|
189 | zz0 = min(zz) |
---|
190 | zz1 = max(zz) |
---|
191 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
192 | outzch1_APR = outz |
---|
193 | lonch1_APR = outx |
---|
194 | latch1_APR = outy |
---|
195 | OUTZCH1_APR[:,:,ijr] = outzch1_APR[:,:] |
---|
196 | ## ch15 ## |
---|
197 | ind_jr15_APR = np.where(jjr15_APR[fovZen_ch15_APR][bbemis_ch15_APR] == ijr+1)[0] |
---|
198 | xx = lon15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR] |
---|
199 | yy = lat15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR] |
---|
200 | zz = emis15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR] |
---|
201 | zz0 = min(zz) |
---|
202 | zz1 = max(zz) |
---|
203 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
204 | outzch15_APR = outz |
---|
205 | lonch15_APR = outx |
---|
206 | latch15_APR = outy |
---|
207 | OUTZCH15_APR[:,:,ijr] = outzch15_APR[:,:] |
---|
208 | |
---|
209 | OUTZ_APR = np.array([OUTZCH1_APR, OUTZCH15_APR]) |
---|
210 | |
---|
211 | ## MAY ## |
---|
212 | imo = 4 |
---|
213 | ## ch1 ## |
---|
214 | fovZen_ch1_MAY = np.where(fov1_MAY == 21.) |
---|
215 | bbemis_ch1_MAY = nonzero((emis1_MAY[fovZen_ch1_MAY] != -500.) & (emis1_MAY[fovZen_ch1_MAY] <= 1.)) |
---|
216 | OUTZCH1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
217 | outzch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
218 | lonch1_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
219 | latch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
220 | ## ch15 ## |
---|
221 | fovZen_ch15_MAY = np.where(fov15_MAY == 21.) |
---|
222 | bbemis_ch15_MAY = nonzero((emis15_MAY[fovZen_ch15_MAY] != -500.) & (emis15_MAY[fovZen_ch15_MAY] <= 1.)) |
---|
223 | OUTZCH15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
224 | outzch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
225 | lonch15_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
226 | latch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
227 | for ijr in range (0, len_month[imo]): |
---|
228 | print 'jour=', ijr+1 |
---|
229 | ## ch1 ## |
---|
230 | ind_jr1_MAY = np.where(jjr1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY] == ijr+1)[0] |
---|
231 | xx = lon1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] |
---|
232 | yy = lat1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] |
---|
233 | zz = emis1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] |
---|
234 | zz0 = min(zz) |
---|
235 | zz1 = max(zz) |
---|
236 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
237 | outzch1_MAY = outz |
---|
238 | lonch1_MAY = outx |
---|
239 | latch1_MAY = outy |
---|
240 | OUTZCH1_MAY[:,:,ijr] = outzch1_MAY[:,:] |
---|
241 | ## ch15 ## |
---|
242 | ind_jr15_MAY = np.where(jjr15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY] == ijr+1)[0] |
---|
243 | xx = lon15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] |
---|
244 | yy = lat15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] |
---|
245 | zz = emis15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] |
---|
246 | zz0 = min(zz) |
---|
247 | zz1 = max(zz) |
---|
248 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
249 | outzch15_MAY = outz |
---|
250 | lonch15_MAY = outx |
---|
251 | latch15_MAY = outy |
---|
252 | OUTZCH15_MAY[:,:,ijr] = outzch15_MAY[:,:] |
---|
253 | |
---|
254 | OUTZ_MAY = np.array([OUTZCH1_MAY, OUTZCH15_MAY]) |
---|
255 | |
---|
256 | |
---|
257 | ## JUNE ## |
---|
258 | imo = 5 |
---|
259 | ## ch1 ## |
---|
260 | fovZen_ch1_JUN = np.where(fov1_JUN == 21.) |
---|
261 | bbemis_ch1_JUN = nonzero((emis1_JUN[fovZen_ch1_JUN] != -500.) & (emis1_JUN[fovZen_ch1_JUN] <= 1.)) |
---|
262 | OUTZCH1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
263 | outzch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
264 | lonch1_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
265 | latch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
266 | ## ch15 ## |
---|
267 | fovZen_ch15_JUN = np.where(fov15_JUN == 21.) |
---|
268 | bbemis_ch15_JUN = nonzero((emis15_JUN[fovZen_ch15_JUN] != -500.) & (emis15_JUN[fovZen_ch15_JUN] <= 1.)) |
---|
269 | OUTZCH15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
270 | outzch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
271 | lonch15_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
272 | latch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
273 | for ijr in range (0, len_month[imo]): |
---|
274 | print 'jour=', ijr+1 |
---|
275 | ## ch1 ## |
---|
276 | ind_jr1_JUN = np.where(jjr1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN] == ijr+1)[0] |
---|
277 | xx = lon1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] |
---|
278 | yy = lat1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] |
---|
279 | zz = emis1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] |
---|
280 | zz0 = min(zz) |
---|
281 | zz1 = max(zz) |
---|
282 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
283 | outzch1_JUN = outz |
---|
284 | lonch1_JUN = outx |
---|
285 | latch1_JUN = outy |
---|
286 | OUTZCH1_JUN[:,:,ijr] = outzch1_JUN[:,:] |
---|
287 | ## ch15 ## |
---|
288 | ind_jr15_JUN = np.where(jjr15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN] == ijr+1)[0] |
---|
289 | xx = lon15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] |
---|
290 | yy = lat15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] |
---|
291 | zz = emis15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] |
---|
292 | zz0 = min(zz) |
---|
293 | zz1 = max(zz) |
---|
294 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
295 | outzch15_JUN = outz |
---|
296 | lonch15_JUN = outx |
---|
297 | latch15_JUN = outy |
---|
298 | OUTZCH15_JUN[:,:,ijr] = outzch15_JUN[:,:] |
---|
299 | |
---|
300 | OUTZ_JUN = np.array([OUTZCH1_JUN, OUTZCH15_JUN]) |
---|
301 | |
---|
302 | |
---|
303 | ## JULY ## |
---|
304 | imo = 6 |
---|
305 | ## ch1 ## |
---|
306 | fovZen_ch1_JUL = np.where(fov1_JUL == 21.) |
---|
307 | bbemis_ch1_JUL = nonzero((emis1_JUL[fovZen_ch1_JUL] != -500.) & (emis1_JUL[fovZen_ch1_JUL] <= 1.)) |
---|
308 | OUTZCH1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
309 | outzch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
310 | lonch1_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
311 | latch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
312 | ## ch15 ## |
---|
313 | fovZen_ch15_JUL = np.where(fov15_JUL == 21.) |
---|
314 | bbemis_ch15_JUL = nonzero((emis15_JUL[fovZen_ch15_JUL] != -500.) & (emis15_JUL[fovZen_ch15_JUL] <= 1.)) |
---|
315 | OUTZCH15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
316 | outzch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
317 | lonch15_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
318 | latch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
319 | for ijr in range (0, len_month[imo]): |
---|
320 | print 'jour=', ijr+1 |
---|
321 | ## ch1 ## |
---|
322 | ind_jr1_JUL = np.where(jjr1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL] == ijr+1)[0] |
---|
323 | xx = lon1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL] |
---|
324 | yy = lat1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL] |
---|
325 | zz = emis1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL] |
---|
326 | zz0 = min(zz) |
---|
327 | zz1 = max(zz) |
---|
328 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
329 | outzch1_JUL = outz |
---|
330 | lonch1_JUL = outx |
---|
331 | latch1_JUL = outy |
---|
332 | OUTZCH1_JUL[:,:,ijr] = outzch1_JUL[:,:] |
---|
333 | ## ch15 ## |
---|
334 | ind_jr15_JUL = np.where(jjr15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL] == ijr+1)[0] |
---|
335 | xx = lon15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL] |
---|
336 | yy = lat15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL] |
---|
337 | zz = emis15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL] |
---|
338 | zz0 = min(zz) |
---|
339 | zz1 = max(zz) |
---|
340 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
341 | outzch15_JUL = outz |
---|
342 | lonch15_JUL = outx |
---|
343 | latch15_JUL = outy |
---|
344 | OUTZCH15_JUL[:,:,ijr] = outzch15_JUL[:,:] |
---|
345 | |
---|
346 | OUTZ_JUL = np.array([OUTZCH1_JUL, OUTZCH15_JUL]) |
---|
347 | |
---|
348 | |
---|
349 | ################################################ |
---|
350 | ## calcul de la climatologie moyenne par mois ## |
---|
351 | ################################################ |
---|
352 | lon = lonch1_FEB |
---|
353 | lat = latch1_FEB |
---|
354 | ## JANUARY ## |
---|
355 | mean_outz_JAN = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
356 | for ich in range (0, len(chan)): |
---|
357 | for ilon in range (0, len(lon)): |
---|
358 | for ilat in range (0, len(lat)): |
---|
359 | mean_outz_JAN[ich, ilat, ilon] = mean(OUTZ_JAN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JAN[ich, ilat, ilon, :]) == False)]) |
---|
360 | |
---|
361 | ## FEBRUARY ## |
---|
362 | mean_outz_FEB = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
363 | for ich in range (0, len(chan)): |
---|
364 | for ilon in range (0, len(lon)): |
---|
365 | for ilat in range (0, len(lat)): |
---|
366 | mean_outz_FEB[ich, ilat, ilon] = mean(OUTZ_FEB[ich, ilat, ilon, :][nonzero(isnan(OUTZ_FEB[ich, ilat, ilon, :]) == False)]) |
---|
367 | |
---|
368 | ## MARCH ## |
---|
369 | mean_outz_MAR = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
370 | for ich in range (0, len(chan)): |
---|
371 | for ilon in range (0, len(lon)): |
---|
372 | for ilat in range (0, len(lat)): |
---|
373 | mean_outz_MAR[ich, ilat, ilon] = mean(OUTZ_MAR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAR[ich, ilat, ilon, :]) == False)]) |
---|
374 | |
---|
375 | ## APRIL ## |
---|
376 | mean_outz_APR = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
377 | for ich in range (0, len(chan)): |
---|
378 | for ilon in range (0, len(lon)): |
---|
379 | for ilat in range (0, len(lat)): |
---|
380 | mean_outz_APR[ich, ilat, ilon] = mean(OUTZ_APR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_APR[ich, ilat, ilon, :]) == False)]) |
---|
381 | |
---|
382 | ## MAY ## |
---|
383 | mean_outz_MAY = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
384 | for ich in range (0, len(chan)): |
---|
385 | for ilon in range (0, len(lon)): |
---|
386 | for ilat in range (0, len(lat)): |
---|
387 | mean_outz_MAY[ich, ilat, ilon] = mean(OUTZ_MAY[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAY[ich, ilat, ilon, :]) == False)]) |
---|
388 | |
---|
389 | ## JUN ## |
---|
390 | mean_outz_JUN = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
391 | for ich in range (0, len(chan)): |
---|
392 | for ilon in range (0, len(lon)): |
---|
393 | for ilat in range (0, len(lat)): |
---|
394 | mean_outz_JUN[ich, ilat, ilon] = mean(OUTZ_JUN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUN[ich, ilat, ilon, :]) == False)]) |
---|
395 | |
---|
396 | ## JULY ## |
---|
397 | mean_outz_JUL = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
398 | for ich in range (0, len(chan)): |
---|
399 | for ilon in range (0, len(lon)): |
---|
400 | for ilat in range (0, len(lat)): |
---|
401 | mean_outz_JUL[ich, ilat, ilon] = mean(OUTZ_JUL[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUL[ich, ilat, ilon, :]) == False)]) |
---|
402 | |
---|
403 | |
---|
404 | mean_outz1 = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL]) |
---|
405 | mean_outz2 = np.array([mean_outz_JAN, mean_outz_MAR, mean_outz_MAY, mean_outz_JUN]) |
---|
406 | |
---|
407 | |
---|
408 | |
---|
409 | month_red = np.array(['JANUARY', 'MARCH', 'MAY', 'JUNE']) |
---|
410 | for imo in range (0, 4): |
---|
411 | plt.figure() |
---|
412 | plt.ion() |
---|
413 | for ich in range (0, len(chan)): |
---|
414 | plt.subplot(2, 1, ich+1) |
---|
415 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
416 | m.drawcoastlines(linewidth = 1) |
---|
417 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
418 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
419 | xii,yii = m(*np.meshgrid(lon, lat)) |
---|
420 | clevs = (arange(0.4, 1., 0.001)) |
---|
421 | cs = m.contourf(xii, yii, mean_outz2[imo, ich, :, :], clevs, cmap=cm.s3pcpn_l_r) |
---|
422 | cbar = colorbar(cs) |
---|
423 | cbar.set_label(chan[ich]+' - 23.8GHz - ' + month_red[imo] + ' - AMSUA') |
---|
424 | xticks(arange(-180, 200, 20), rotation = 45) |
---|
425 | yticks(arange(-90, -10, 20)) |
---|
426 | |
---|
427 | |
---|
428 | ###################### |
---|
429 | ## calculs de stats ## |
---|
430 | ###################### |
---|
431 | ## FEBRUARY ## |
---|
432 | imo = 1 |
---|
433 | ### VARIANCE ## |
---|
434 | var = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
435 | for ich in range (0, len(chan)): |
---|
436 | for ilon in range (0, len(lon)): |
---|
437 | for ilat in range (0, len(lat)): |
---|
438 | var[ich, ilat, ilon] = np.sum((OUTZ_FEB[ich, ilat, ilon, :][nonzero(isnan(OUTZ_FEB[ich, ilat, ilon, :]) == False)] - mean_outz_FEB[ich, ilat, ilon])**2) |
---|
439 | |
---|
440 | var_FEB = var / len_month[imo] |
---|
441 | |
---|
442 | ## APRIL ## |
---|
443 | imo = 3 |
---|
444 | ### VARIANCE ## |
---|
445 | var = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
446 | for ich in range (0, len(chan)): |
---|
447 | for ilon in range (0, len(lon)): |
---|
448 | for ilat in range (0, len(lat)): |
---|
449 | var[ich, ilat, ilon] = np.sum((OUTZ_APR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_APR[ich, ilat, ilon, :]) == False)] - mean_outz_APR[ich, ilat, ilon])**2) |
---|
450 | |
---|
451 | var_APR = var / len_month[imo] |
---|
452 | |
---|
453 | ## JULY ## |
---|
454 | imo = 6 |
---|
455 | ### VARIANCE ## |
---|
456 | var = np.zeros([len(chan), len(lat), len(lon)], float) |
---|
457 | for ich in range (0, len(chan)): |
---|
458 | for ilon in range (0, len(lon)): |
---|
459 | for ilat in range (0, len(lat)): |
---|
460 | var[ich, ilat, ilon] = np.sum((OUTZ_JUL[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUL[ich, ilat, ilon, :]) == False)] - mean_outz_JUL[ich, ilat, ilon])**2) |
---|
461 | |
---|
462 | var_JUL = var / len_month[imo] |
---|
463 | |
---|
464 | |
---|
465 | |
---|
466 | |
---|
467 | plt.figure() |
---|
468 | plt.ion() |
---|
469 | #plt.subplot(2, 1, 1) |
---|
470 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
471 | m.drawcoastlines(linewidth = 1) |
---|
472 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
473 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
474 | xii,yii = m(*np.meshgrid(lon, lat)) |
---|
475 | clevs = (arange(0.5, 0.9, 0.001)) |
---|
476 | cs = m.contourf(xii, yii, OUTZ_JAN[0, :, :,20], clevs, cmap=cm.s3pcpn_l_r) |
---|
477 | cbar = colorbar(cs) |
---|
478 | cbar.set_label('CH1 - 23.8GHz') |
---|
479 | plt.title('var(emis) JUL - AMSUA') |
---|
480 | xticks(arange(-180, 200, 20), rotation = 45) |
---|
481 | yticks(arange(-90, -10, 20)) |
---|
482 | plt.subplot(2, 1, 2) |
---|
483 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
484 | m.drawcoastlines(linewidth = 1) |
---|
485 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
486 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
487 | xii,yii = m(*np.meshgrid(lon, lat)) |
---|
488 | clevs = (arange(0., 0.0035, 0.00001)) |
---|
489 | cs = m.contourf(xii, yii, var_JUL[1, :, :], clevs, cmap=cm.s3pcpn_l_r) |
---|
490 | cbar = colorbar(cs) |
---|
491 | cbar.set_label('CH15 - 89GHz') |
---|
492 | xticks(arange(-180, 200, 20), rotation = 45) |
---|
493 | yticks(arange(-90, -10, 20)) |
---|
494 | |
---|
495 | |
---|
496 | |
---|
497 | |
---|
498 | |
---|