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 | |
---|
14 | |
---|
15 | ######################## |
---|
16 | # EVOLUTION TEMPORELLE # |
---|
17 | ######################## |
---|
18 | |
---|
19 | ## ZONE1 = Autour de "Dome C" (lon=123.23;lat=-75.06) - mois: JUNE ## |
---|
20 | ## ch17 ## |
---|
21 | #bbzone_CH17_JUN = nonzero((lon17_JUN >= 120.23) & (lon17_JUN <= 126.23) & (lat17_JUN >= -78.06) & (lat17_JUN <= -72.06)) |
---|
22 | |
---|
23 | ## ch18 ## |
---|
24 | #bbzone_CH18_JUN = nonzero((lon18_JUN >= 120.23) & (lon18_JUN <= 126.23) & (lat18_JUN >= -78.06) & (lat18_JUN <= -72.06)) |
---|
25 | |
---|
26 | |
---|
27 | ## ZONE2 = Autre zone de glace de mer / de continent (lon entre -40 et -60 // lat entre -75 et -85) ## |
---|
28 | ## ch17 ## |
---|
29 | bbzone_CH17_FEB = nonzero((lon17_FEB >= -60.) & (lon17_FEB <= -40.) & (lat17_FEB >= -85.) & (lat17_FEB <= -75.)) |
---|
30 | bbzone_CH17_APR = nonzero((lon17_APR >= -60.) & (lon17_APR <= -40.) & (lat17_APR >= -85.) & (lat17_APR <= -75.)) |
---|
31 | bbzone_CH17_MAY = nonzero((lon17_MAY >= -60.) & (lon17_MAY <= -40.) & (lat17_MAY >= -85.) & (lat17_MAY <= -75.)) |
---|
32 | bbzone_CH17_JUN = nonzero((lon17_JUN >= -60.) & (lon17_JUN <= -40.) & (lat17_JUN >= -85.) & (lat17_JUN <= -75.)) |
---|
33 | bbzone_CH17_JUL = nonzero((lon17_JUL >= -60.) & (lon17_JUL <= -40.) & (lat17_JUL >= -85.) & (lat17_JUL <= -75.)) |
---|
34 | |
---|
35 | ## ch18 ## |
---|
36 | #bbzone_CH18_JUN = nonzero((lon18_JUN >= -60.) & (lon18_JUN <= -40.) & (lat18_JUN >= -85.) & (lat18_JUN <= -75.)) |
---|
37 | |
---|
38 | ## ch 16 ## |
---|
39 | #bbzone_CH16_JUN = nonzero((lon16_JUN >= 120.23) & (lon16_JUN <= 126.23) & (lat16_JUN >= -78.06) & (lat16_JUN <= -72.06)) |
---|
40 | |
---|
41 | |
---|
42 | ## FEBUARY ## |
---|
43 | emis17_FEB_moy = np.zeros([28],float) |
---|
44 | tb17_FEB_moy = np.zeros([28],float) |
---|
45 | ts17_FEB_moy = np.zeros([28],float) |
---|
46 | orog17_FEB_moy = np.zeros([28],float) |
---|
47 | for ijr in range (0,28): |
---|
48 | print 'jour=', ijr+1 |
---|
49 | ## ch17 ## |
---|
50 | ind_jr17_FEB = np.where(jjr17_FEB[bbzone_CH17_FEB]==ijr+1)[0] |
---|
51 | a = emis17_FEB[bbzone_CH17_FEB][ind_jr17_FEB] |
---|
52 | b = tb17_FEB[bbzone_CH17_FEB][ind_jr17_FEB] |
---|
53 | c = ts17_FEB[bbzone_CH17_FEB][ind_jr17_FEB] |
---|
54 | d = orog17_FEB[bbzone_CH17_FEB][ind_jr17_FEB] |
---|
55 | emis17_FEB_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))]) |
---|
56 | tb17_FEB_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))]) |
---|
57 | ts17_FEB_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))]) |
---|
58 | orog17_FEB_moy[ijr] = mean(d[nonzero((d!=-500.))]) |
---|
59 | |
---|
60 | |
---|
61 | ## APRIL ## |
---|
62 | emis17_APR_moy = np.zeros([30],float) |
---|
63 | tb17_APR_moy = np.zeros([30],float) |
---|
64 | ts17_APR_moy = np.zeros([30],float) |
---|
65 | orog17_APR_moy = np.zeros([30],float) |
---|
66 | for ijr in range (0,30): |
---|
67 | print 'jour=', ijr+1 |
---|
68 | ind_jr17_APR = np.where(jjr17_APR[bbzone_CH17_APR]==ijr+1)[0] |
---|
69 | a = emis17_APR[bbzone_CH17_APR][ind_jr17_APR] |
---|
70 | b = tb17_APR[bbzone_CH17_APR][ind_jr17_APR] |
---|
71 | c = ts17_APR[bbzone_CH17_APR][ind_jr17_APR] |
---|
72 | d = orog17_APR[bbzone_CH17_APR][ind_jr17_APR] |
---|
73 | emis17_APR_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))]) |
---|
74 | tb17_APR_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))]) |
---|
75 | ts17_APR_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))]) |
---|
76 | orog17_APR_moy[ijr] = mean(d[nonzero((d!=-500.))]) |
---|
77 | |
---|
78 | |
---|
79 | ## MAY ## |
---|
80 | emis17_MAY_moy = np.zeros([31],float) |
---|
81 | tb17_MAY_moy = np.zeros([31],float) |
---|
82 | ts17_MAY_moy = np.zeros([31],float) |
---|
83 | orog17_MAY_moy = np.zeros([31],float) |
---|
84 | for ijr in range (0,31): |
---|
85 | print 'jour=', ijr+1 |
---|
86 | ind_jr17_MAY = np.where(jjr17_MAY[bbzone_CH17_MAY]==ijr+1)[0] |
---|
87 | a = emis17_MAY[bbzone_CH17_MAY][ind_jr17_MAY] |
---|
88 | b = tb17_MAY[bbzone_CH17_MAY][ind_jr17_MAY] |
---|
89 | c = ts17_MAY[bbzone_CH17_MAY][ind_jr17_MAY] |
---|
90 | d = orog17_MAY[bbzone_CH17_MAY][ind_jr17_MAY] |
---|
91 | emis17_MAY_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))]) |
---|
92 | tb17_MAY_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))]) |
---|
93 | ts17_MAY_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))]) |
---|
94 | orog17_MAY_moy[ijr] = mean(d[nonzero((d!=-500.))]) |
---|
95 | |
---|
96 | |
---|
97 | ## JUNE ## |
---|
98 | emis17_JUN_moy = np.zeros([30],float) |
---|
99 | tb17_JUN_moy = np.zeros([30],float) |
---|
100 | ts17_JUN_moy = np.zeros([30],float) |
---|
101 | #orog17_JUN_moy = np.zeros([30],float) |
---|
102 | #emis18_JUN_moy = np.zeros([30],float) |
---|
103 | #tb18_JUN_moy = np.zeros([30],float) |
---|
104 | #ts18_JUN_moy = np.zeros([30],float) |
---|
105 | #emis16_JUN_moy = np.zeros([30],float) |
---|
106 | #tb16_JUN_moy = np.zeros([30],float) |
---|
107 | #ts16_JUN_moy = np.zeros([30],float) |
---|
108 | for ijr in range (0,30): |
---|
109 | print 'jour=', ijr+1 |
---|
110 | ind_jr17_JUN = np.where(jjr17_JUN[bbzone_CH17_JUN]==ijr+1)[0] |
---|
111 | a = emis17_JUN[bbzone_CH17_JUN][ind_jr17_JUN] |
---|
112 | b = tb17_JUN[bbzone_CH17_JUN][ind_jr17_JUN] |
---|
113 | c = ts17_JUN[bbzone_CH17_JUN][ind_jr17_JUN] |
---|
114 | d = orog17_JUN[bbzone_CH17_JUN][ind_jr17_JUN] |
---|
115 | emis17_JUN_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))]) |
---|
116 | tb17_JUN_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))]) |
---|
117 | ts17_JUN_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))]) |
---|
118 | # orog17_JUN_moy[ijr] = mean(d[nonzero((d!=-500.))]) |
---|
119 | ## ch18 ## |
---|
120 | # ind_jr18 = np.where(jjr18_JUN[bbzone_CH18_JUN]==ijr+1)[0] |
---|
121 | # d = emis18_JUN[bbzone_CH18_JUN][ind_jr18] |
---|
122 | # e = tb18_JUN[bbzone_CH18_JUN][ind_jr18] |
---|
123 | # f = ts18_JUN[bbzone_CH18_JUN][ind_jr18] |
---|
124 | # emis18_JUN_moy[ijr] = mean(d[nonzero((d != -500.) & (d <= 1.))]) |
---|
125 | # tb18_JUN_moy[ijr] = mean(e[nonzero((e != -500.) & (e != 0.))]) |
---|
126 | # ts18_JUN_moy[ijr] = mean(f[nonzero((f != -500.) & (f != 0.))]) |
---|
127 | ## ch16 ## |
---|
128 | # ind_jr16 = np.where(jjr16_JUN[bbzone_CH16_JUN]==ijr+1)[0] |
---|
129 | # g = emis16_JUN[bbzone_CH16_JUN][ind_jr16] |
---|
130 | # h = tb16_JUN[bbzone_CH16_JUN][ind_jr16] |
---|
131 | # l = ts16_JUN[bbzone_CH16_JUN][ind_jr16] |
---|
132 | # emis16_JUN_moy[ijr] = mean(g[nonzero((g != -500.) & (g <= 1.))]) |
---|
133 | # tb16_JUN_moy[ijr] = mean(h[nonzero((h != -500.) & (h != 0.))]) |
---|
134 | # ts16_JUN_moy[ijr] = mean(l[nonzero((l != -500.) & (l != 0.))]) |
---|
135 | |
---|
136 | |
---|
137 | ## JULY ## |
---|
138 | emis17_JUL_moy = np.zeros([31],float) |
---|
139 | tb17_JUL_moy = np.zeros([31],float) |
---|
140 | ts17_JUL_moy = np.zeros([31],float) |
---|
141 | orog17_JUL_moy = np.zeros([31],float) |
---|
142 | for ijr in range (0,31): |
---|
143 | print 'jour=', ijr+1 |
---|
144 | ind_jr17_JUL = np.where(jjr17_JUL[bbzone_CH17_JUL]==ijr+1)[0] |
---|
145 | a = emis17_JUL[bbzone_CH17_JUL][ind_jr17_JUL] |
---|
146 | b = tb17_JUL[bbzone_CH17_JUL][ind_jr17_JUL] |
---|
147 | c = ts17_JUL[bbzone_CH17_JUL][ind_jr17_JUL] |
---|
148 | d = orog17_JUL[bbzone_CH17_JUL][ind_jr17_JUL] |
---|
149 | emis17_JUL_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))]) |
---|
150 | tb17_JUL_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))]) |
---|
151 | ts17_JUL_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))]) |
---|
152 | orog17_JUL_moy[ijr] = mean(d[nonzero((d!=-500.))]) |
---|
153 | |
---|
154 | |
---|
155 | ## plot evolution temporelle ## |
---|
156 | ## FEBUARY ## |
---|
157 | fig = plt.figure() |
---|
158 | plt.subplot(3, 1, 1) |
---|
159 | plt.title('FEBUARY') |
---|
160 | plt.plot(arange(0, 28, 1), emis17_FEB_moy, c = 'b') |
---|
161 | plt.ylabel('Emissivity') |
---|
162 | xticks(arange(0, 28, 1), arange(1, 29, 1)) |
---|
163 | xlim (0, 28) |
---|
164 | grid(True) |
---|
165 | plt.subplot(3, 1, 2) |
---|
166 | plt.plot(arange(0, 28, 1), tb17_FEB_moy, c = 'g', label = 'Tb') |
---|
167 | ylabel('Brightness temperature') |
---|
168 | xticks(arange(0, 28, 1), arange(1, 29, 1)) |
---|
169 | xlim (0, 28) |
---|
170 | grid(True) |
---|
171 | plt.subplot(3, 1, 3) |
---|
172 | plt.plot(arange(0, 28, 1), ts17_FEB_moy, c = 'r', label = 'Ts') |
---|
173 | plt.ylabel('Surface temperature') |
---|
174 | xticks(arange(0, 28, 1), arange(1, 29, 1)) |
---|
175 | xlim (0, 28) |
---|
176 | grid(True) |
---|
177 | fig.show() |
---|
178 | |
---|
179 | ## from APRIL to JULY ## |
---|
180 | emis1 = np.append(emis17_APR_moy, emis17_MAY_moy) |
---|
181 | emis2 = np.append(emis1, emis17_JUN_moy) |
---|
182 | emis17_moy = np.append(emis2, emis17_JUL_moy) |
---|
183 | tb1 = np.append(tb17_APR_moy, tb17_MAY_moy) |
---|
184 | tb2 = np.append(tb1, tb17_JUN_moy) |
---|
185 | tb17_moy = np.append(tb2, tb17_JUL_moy) |
---|
186 | ts1 = np.append(ts17_APR_moy, ts17_MAY_moy) |
---|
187 | ts2 = np.append(ts1, ts17_JUN_moy) |
---|
188 | ts17_moy = np.append(ts2, ts17_JUL_moy) |
---|
189 | fig = plt.figure() |
---|
190 | plt.subplot(3, 1, 1) |
---|
191 | plt.plot(arange(0, 122, 1), emis17_moy, c = 'b') |
---|
192 | plt.ylabel('Emissivity') |
---|
193 | xticks(array([0, 30, 61, 91, 122]), date[1:]) |
---|
194 | xlim (0, 122) |
---|
195 | grid(True) |
---|
196 | plt.subplot(3, 1, 2) |
---|
197 | plt.plot(arange(0, 122, 1), tb17_moy, c = 'g', label = 'Tb') |
---|
198 | ylabel('Brightness temperature') |
---|
199 | xticks(array([0, 30, 61, 91, 122]), date[1:]) |
---|
200 | xlim (0, 122) |
---|
201 | grid(True) |
---|
202 | plt.subplot(3, 1, 3) |
---|
203 | plt.plot(arange(0, 122, 1), ts17_moy, c = 'r', label = 'Ts') |
---|
204 | plt.ylabel('Surface temperature') |
---|
205 | xticks(array([0, 30, 61, 91, 122]), date[1:]) |
---|
206 | xlim (0, 122) |
---|
207 | grid(True) |
---|
208 | fig.show() |
---|
209 | |
---|
210 | ## JUNE ## |
---|
211 | ## ch17 - ch18 ## |
---|
212 | fig=plt.figure() |
---|
213 | plt.subplot(3,1,1) |
---|
214 | plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='r') |
---|
215 | plt.plot(arange(0,30,1),emis18_JUN_moy,label='91.66GHz-H',c='b') |
---|
216 | plt.xticks(arange(1,31,1)) |
---|
217 | grid(True) |
---|
218 | ylabel('emissivity') |
---|
219 | legend(loc=7) |
---|
220 | plt.title('SSMIS - JUNE 2010') |
---|
221 | plt.subplot(3,1,2) |
---|
222 | plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='r') |
---|
223 | plt.plot(arange(0,30,1),tb18_JUN_moy,label='91.66GHz-H',c='b') |
---|
224 | plt.xticks(arange(1,31,1)) |
---|
225 | grid(True) |
---|
226 | ylabel('brightness temperature') |
---|
227 | legend(loc=7) |
---|
228 | plt.subplot(3,1,3) |
---|
229 | plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='r') |
---|
230 | plt.plot(arange(0,30,1),ts18_JUN_moy,label='91.66GHz-H',c='b') |
---|
231 | plt.xticks(arange(1,31,1)) |
---|
232 | grid(True) |
---|
233 | ylabel('surface temperature') |
---|
234 | legend(loc=7) |
---|
235 | fig.show() |
---|
236 | ## ch16 - ch17 ## |
---|
237 | fig=plt.figure() |
---|
238 | plt.subplot(3,1,1) |
---|
239 | plt.plot(arange(0,30,1),emis16_JUN_moy,label='37GHz-V',c='r') |
---|
240 | plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='g') |
---|
241 | plt.xticks(arange(1,31,1)) |
---|
242 | grid(True) |
---|
243 | ylabel('emissivity') |
---|
244 | legend(loc=7) |
---|
245 | plt.title('SSMIS - JUNE 2010') |
---|
246 | plt.subplot(3,1,2) |
---|
247 | plt.plot(arange(0,30,1),tb16_JUN_moy,label='37GHz-V',c='r') |
---|
248 | plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='g') |
---|
249 | plt.xticks(arange(1,31,1)) |
---|
250 | grid(True) |
---|
251 | ylabel('brightness temperature') |
---|
252 | legend(loc=7) |
---|
253 | plt.subplot(3,1,3) |
---|
254 | plt.plot(arange(0,30,1),ts16_JUN_moy,label='37GHz-V',c='r') |
---|
255 | plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='g') |
---|
256 | plt.xticks(arange(1,31,1)) |
---|
257 | grid(True) |
---|
258 | ylabel('surface temperature') |
---|
259 | legend(loc=7) |
---|
260 | fig.show() |
---|
261 | |
---|
262 | |
---|
263 | ## calcul anomalie de Tb |
---|
264 | ## FEBUARY ## |
---|
265 | tb17_FEB_anom = np.zeros([28], float) |
---|
266 | for ijr in range (0,28): |
---|
267 | print 'jour=', ijr + 1 |
---|
268 | tb17_FEB_anom[ijr]=tb17_FEB_moy[ijr]-mean(tb17_FEB_moy) |
---|
269 | |
---|
270 | ## APRIL ## |
---|
271 | tb17_APR_anom = np.zeros([30], float) |
---|
272 | for ijr in range (0,30): |
---|
273 | print 'jour=', ijr + 1 |
---|
274 | tb17_APR_anom[ijr]=tb17_APR_moy[ijr]-mean(tb17_APR_moy) |
---|
275 | |
---|
276 | ## MAY ## |
---|
277 | bbnan = nonzero(isnan(tb17_MAY_moy) == False) |
---|
278 | tb17_MAY_anom = np.zeros([31], float) |
---|
279 | for ijr in range (0,31): |
---|
280 | print 'jour=', ijr + 1 |
---|
281 | tb17_MAY_anom[ijr]=tb17_MAY_moy[ijr]-mean(tb17_MAY_moy[bbnan]) |
---|
282 | |
---|
283 | ## JUNE ## |
---|
284 | tb17_JUN_anom = np.zeros([30],float) |
---|
285 | #tb18_JUN_anom = np.zeros([30],float) |
---|
286 | for ijr in range (0,30): |
---|
287 | print 'jour=', ijr + 1 |
---|
288 | tb17_JUN_anom[ijr]=tb17_JUN_moy[ijr]-mean(tb17_JUN_moy) |
---|
289 | # tb18_JUN_anom[ijr]=tb18_JUN_moy[ijr]-mean(tb18_JUN_moy) |
---|
290 | |
---|
291 | ## JULY ## |
---|
292 | tb17_JUL_anom = np.zeros([31],float) |
---|
293 | for ijr in range (0,30): |
---|
294 | print 'jour=', ijr + 1 |
---|
295 | tb17_JUL_anom[ijr]=tb17_JUL_moy[ijr]-mean(tb17_JUL_moy) |
---|
296 | |
---|
297 | |
---|
298 | |
---|
299 | a1 = np.append(tb17_APR_anom, tb17_MAY_anom) |
---|
300 | a2 = np.append(a1, tb17_JUN_anom) |
---|
301 | tb17_month_anom = np.append(a2, tb17_JUL_anom) |
---|
302 | |
---|
303 | |
---|
304 | ## for APRIL to JULY ## |
---|
305 | fig = plt.figure() |
---|
306 | plt.plot(arange(0, 122, 1), tb17_month_anom, c = 'k') |
---|
307 | plt.plot(arange(0, 122, 1), np.zeros([122]), '--', c = 'r') |
---|
308 | ylabel('Tb anomaly (K)') |
---|
309 | xlim(0, 122) |
---|
310 | xticks(array([0, 30, 61, 91 122]), date[1:]) |
---|
311 | grid(True) |
---|
312 | plt.title('SSMIS - zone2') |
---|
313 | fig.show() |
---|
314 | |
---|
315 | ## FEBRUARY ## |
---|
316 | fig = plt.figure() |
---|
317 | plt.plot(arange(0, 28, 1), tb17_FEB_anom, c = 'k') |
---|
318 | plt.plot(arange(0, 28, 1), np.zeros([28]), '--', c = 'r') |
---|
319 | ylabel('Tb anomaly (K)') |
---|
320 | xlim(0, 27) |
---|
321 | xticks(arange(0, 28, 1), arange(1, 29, 1)) |
---|
322 | grid(True) |
---|
323 | plt.xlabel('FABRUARY') |
---|
324 | plt.title('SSMIS - zone2') |
---|
325 | fig.show() |
---|
326 | |
---|
327 | ## JUNE ## |
---|
328 | fig=plt.figure() |
---|
329 | plt.plot(arange(0,30,1),tb17_JUN_anom,label='91.66Ghz-V',c='r') |
---|
330 | plt.plot(arange(0,30,1),tb18_JUN_anom,label='91.66GHz-H',c='b') |
---|
331 | plt.plot(arange(0,31,1),np.zeros([31]),'--',c='k') |
---|
332 | ylabel('Tb anomaly') |
---|
333 | legend() |
---|
334 | twinx().plot(arange(0,30,1),ts17_JUN_moy,label='surface temperature',c='g') |
---|
335 | ylabel('surface temperature') |
---|
336 | plt.xticks(arange(0, 30, 1), arange(1, 31, 1)) |
---|
337 | grid(True) |
---|
338 | plt.title('SSMIS - JUNE 2010') |
---|
339 | fig.show() |
---|
340 | |
---|
341 | |
---|
342 | |
---|
343 | |
---|
344 | ################ |
---|
345 | # CARTOGRAPHIE # |
---|
346 | ################ |
---|
347 | ## Etude sur l'Antarctique ## |
---|
348 | dx=5. |
---|
349 | dy=5. |
---|
350 | x0, x1 = -180, 180 |
---|
351 | y0, y1 = -90, -30 |
---|
352 | |
---|
353 | |
---|
354 | ## FEBRUARY ## |
---|
355 | bbtb_ch17_FEB = nonzero((tb17_FEB != -500.) & (tb17_FEB != 0.)) |
---|
356 | OUTZCH17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),28], float) |
---|
357 | outzch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
358 | lonch17_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
359 | latch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
360 | for ijr in range(0,28): |
---|
361 | print 'jour=', ijr+1 |
---|
362 | ## ch17 ## |
---|
363 | ind_jr17_FEB = np.where(jjr17_FEB[bbtb_ch17_FEB] == ijr+1)[0] |
---|
364 | xx = lon17_FEB[bbtb_ch17_FEB][ind_jr17_FEB] |
---|
365 | yy = lat17_FEB[bbtb_ch17_FEB][ind_jr17_FEB] |
---|
366 | zz = tb17_FEB[bbtb_ch17_FEB][ind_jr17_FEB] |
---|
367 | zz0 = min(zz) |
---|
368 | zz1 = max(zz) |
---|
369 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
370 | outzch17_FEB = outz |
---|
371 | lonch17_FEB = outx |
---|
372 | latch17_FEB = outy |
---|
373 | OUTZCH17_FEB[:,:,ijr] = outzch17_FEB[:,:] |
---|
374 | |
---|
375 | ## APRIL ## |
---|
376 | bbtb_ch17_APR = nonzero((tb17_APR != -500.) & (tb17_APR != 0.)) |
---|
377 | OUTZCH17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float) |
---|
378 | outzch17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
379 | lonch17_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
380 | latch17_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
381 | for ijr in range(0,30): |
---|
382 | print 'jour=', ijr+1 |
---|
383 | ## ch17 ## |
---|
384 | ind_jr17_APR = np.where(jjr17_APR[bbtb_ch17_APR] == ijr+1)[0] |
---|
385 | xx = lon17_APR[bbtb_ch17_APR][ind_jr17_APR] |
---|
386 | yy = lat17_APR[bbtb_ch17_APR][ind_jr17_APR] |
---|
387 | zz = tb17_APR[bbtb_ch17_APR][ind_jr17_APR] |
---|
388 | zz0 = min(zz) |
---|
389 | zz1 = max(zz) |
---|
390 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
391 | outzch17_APR = outz |
---|
392 | lonch17_APR = outx |
---|
393 | latch17_APR = outy |
---|
394 | OUTZCH17_APR[:,:,ijr] = outzch17_APR[:,:] |
---|
395 | |
---|
396 | ## MAY ## |
---|
397 | bbtb_ch17_MAY = nonzero((tb17_MAY != -500.) & (tb17_MAY != 0.)) |
---|
398 | OUTZCH17_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),31], float) |
---|
399 | outzch17_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
400 | lonch17_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
401 | latch17_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
402 | for ijr in range(0,31): |
---|
403 | print 'jour=', ijr+1 |
---|
404 | ## ch17 ## |
---|
405 | ind_jr17_MAY = np.where(jjr17_MAY[bbtb_ch17_MAY] == ijr+1)[0] |
---|
406 | xx = lon17_MAY[bbtb_ch17_MAY][ind_jr17_MAY] |
---|
407 | yy = lat17_MAY[bbtb_ch17_MAY][ind_jr17_MAY] |
---|
408 | zz = tb17_MAY[bbtb_ch17_MAY][ind_jr17_MAY] |
---|
409 | zz0 = min(zz) |
---|
410 | zz1 = max(zz) |
---|
411 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
412 | outzch17_MAY = outz |
---|
413 | lonch17_MAY = outx |
---|
414 | latch17_MAY = outy |
---|
415 | OUTZCH17_MAY[:,:,ijr] = outzch17_MAY[:,:] |
---|
416 | |
---|
417 | ## JUNE ## |
---|
418 | ## ch17 ## |
---|
419 | bbtb_ch17_JUN = nonzero((tb17_JUN != -500.) & (tb17_JUN != 0.)) |
---|
420 | OUTZCH17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float) |
---|
421 | outzch17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
422 | lonch17_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
423 | latch17_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
424 | ## ch18 ## |
---|
425 | bbemis_ch18_JUN=nonzero((emis18_JUN!=-500.)&(emis18_JUN<1.)&(emis18_JUN>0.)) |
---|
426 | bbtb_ch18_JUN=nonzero((tb18_JUN!=-500.)&(tb18_JUN!=0.)) |
---|
427 | OUTZCH18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float) |
---|
428 | outzch18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
429 | lonch18_JUN=np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
430 | latch18_JUN=np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
431 | for ijr in range(0,30): |
---|
432 | print 'jour=', ijr+1 |
---|
433 | ## ch17 ## |
---|
434 | ind_jr17_JUN = np.where(jjr17_JUN[bbtb_ch17_JUN] == ijr+1)[0] |
---|
435 | xx = lon17_JUN[bbtb_ch17_JUN][ind_jr17_JUN] |
---|
436 | yy = lat17_JUN[bbtb_ch17_JUN][ind_jr17_JUN] |
---|
437 | zz = tb17_JUN[bbtb_ch17_JUN][ind_jr17_JUN] |
---|
438 | zz0 = min(zz) |
---|
439 | zz1 = max(zz) |
---|
440 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
441 | outzch17_JUN = outz |
---|
442 | lonch17_JUN = outx |
---|
443 | latch17_JUN = outy |
---|
444 | OUTZCH17_JUN[:,:,ijr] = outzch17_JUN[:,:] |
---|
445 | ## ch18 ## |
---|
446 | ind_jr18_JUN = np.where(jjr18_JUN[bbtb_ch18_JUN] == ijr+1)[0] |
---|
447 | xx = lon18_JUN[bbtb_ch18_JUN][ind_jr18_JUN] |
---|
448 | yy = lat18_JUN[bbtb_ch18_JUN][ind_jr18_JUN] |
---|
449 | zz = tb18_JUN[bbtb_ch18_JUN][ind_jr18_JUN] |
---|
450 | zz0 = min(zz) |
---|
451 | zz1 = max(zz) |
---|
452 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
453 | outzch18_JUN = outz |
---|
454 | lonch18_JUN = outx |
---|
455 | latch18_JUN = outy |
---|
456 | OUTZCH18_JUN[:,:,ijr] = outzch18_JUN[:,:] |
---|
457 | |
---|
458 | ## JULY ## |
---|
459 | bbtb_ch17_JUL = nonzero((tb17_JUL != -500.) & (tb17_JUL != 0.)) |
---|
460 | OUTZCH17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),31], float) |
---|
461 | outzch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
462 | lonch17_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
463 | latch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
464 | for ijr in range(0,31): |
---|
465 | print 'jour=', ijr+1 |
---|
466 | ## ch17 ## |
---|
467 | ind_jr17_JUL = np.where(jjr17_JUL[bbtb_ch17_JUL] == ijr+1)[0] |
---|
468 | xx = lon17_JUL[bbtb_ch17_JUL][ind_jr17_JUL] |
---|
469 | yy = lat17_JUL[bbtb_ch17_JUL][ind_jr17_JUL] |
---|
470 | zz = tb17_JUL[bbtb_ch17_JUL][ind_jr17_JUL] |
---|
471 | zz0 = min(zz) |
---|
472 | zz1 = max(zz) |
---|
473 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
474 | outzch17_JUL = outz |
---|
475 | lonch17_JUL = outx |
---|
476 | latch17_JUL = outy |
---|
477 | OUTZCH17_JUL[:,:,ijr] = outzch17_JUL[:,:] |
---|
478 | |
---|
479 | |
---|
480 | ## calcul de la climatologie moyenne sur le mois et anomalie en chaque lon/lat ## |
---|
481 | ## FEBRUARY ## |
---|
482 | mean_outzch17_FEB = np.zeros([len(latch17_FEB), len(lonch17_FEB)], float) |
---|
483 | for ilon in range (0,len(lonch17_FEB)): |
---|
484 | for ilat in range (0,len(latch17_FEB)): |
---|
485 | mean_outzch17_FEB[ilat,ilon] = mean(OUTZCH17_FEB[ilat,ilon,:]) |
---|
486 | |
---|
487 | tbch17_anom_FEB = np.zeros([len(latch17_FEB),len(lonch17_FEB),28], float) |
---|
488 | for ijr in range (0,28): |
---|
489 | tbch17_anom_FEB[:,:,ijr] = OUTZCH17_FEB[:,:,ijr] - mean_outzch17_FEB[:,:] |
---|
490 | |
---|
491 | ## APRIL ## |
---|
492 | mean_outzch17_APR = np.zeros([len(latch17_APR), len(lonch17_APR)], float) |
---|
493 | for ilon in range (0,len(lonch17_APR)): |
---|
494 | for ilat in range (0,len(latch17_APR)): |
---|
495 | mean_outzch17_APR[ilat,ilon] = mean(OUTZCH17_APR[ilat,ilon,:]) |
---|
496 | |
---|
497 | tbch17_anom_APR = np.zeros([len(latch17_APR),len(lonch17_APR),30], float) |
---|
498 | for ijr in range (0,30): |
---|
499 | tbch17_anom_APR[:,:,ijr] = OUTZCH17_APR[:,:,ijr] - mean_outzch17_APR[:,:] |
---|
500 | |
---|
501 | ## MAY ## |
---|
502 | mean_outzch17_MAY = np.zeros([len(latch17_MAY), len(lonch17_MAY)], float) |
---|
503 | for ilon in range (0,len(lonch17_MAY)): |
---|
504 | for ilat in range (0,len(latch17_MAY)): |
---|
505 | mean_outzch17_MAY[ilat,ilon] = mean(OUTZCH17_MAY[ilat,ilon,:]) |
---|
506 | |
---|
507 | tbch17_anom_MAY = np.zeros([len(latch17_MAY),len(lonch17_MAY),31], float) |
---|
508 | for ijr in range (0,31): |
---|
509 | tbch17_anom_MAY[:,:,ijr] = OUTZCH17_MAY[:,:,ijr] - mean_outzch17_MAY[:,:] |
---|
510 | |
---|
511 | |
---|
512 | ## JUNE ## |
---|
513 | ## ch17 ## |
---|
514 | mean_outzch17_JUN = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float) |
---|
515 | for ilon in range (0,len(lonch17_JUN)): |
---|
516 | for ilat in range (0,len(latch17_JUN)): |
---|
517 | mean_outzch17_JUN[ilat,ilon] = OUTZCH17_JUN[ilat,ilon,:].mean() |
---|
518 | |
---|
519 | tbch17_anom_JUN = np.zeros([len(latch17_JUN),len(lonch17_JUN),30], float) |
---|
520 | for ijr in range (0,30): |
---|
521 | tbch17_anom_JUN[:,:,ijr] = OUTZCH17_JUN[:,:,ijr] - mean_outzch17_JUN[:,:] |
---|
522 | |
---|
523 | ## ch18 ## |
---|
524 | mean_outzch18_JUN = np.zeros([len(latch18_JUN), len(lonch18_JUN)], float) |
---|
525 | for ilon in range (0,len(lonch18_JUN)): |
---|
526 | for ilat in range (0,len(latch18_JUN)): |
---|
527 | mean_outzch18_JUN[ilat,ilon] = OUTZCH18_JUN[ilat,ilon,:].mean() |
---|
528 | |
---|
529 | tbch18_anom_JUN = np.zeros([len(latch18_JUN),len(lonch18_JUN),30], float) |
---|
530 | for ijr in range (0,30): |
---|
531 | tbch18_anom_JUN[:,:,ijr] = OUTZCH18_JUN[:,:,ijr] - mean_outzch18_JUN[:,:] |
---|
532 | |
---|
533 | |
---|
534 | |
---|
535 | for ijr in range (23, 30): |
---|
536 | figure() |
---|
537 | plt.ion() |
---|
538 | m = Basemap(llcrnrlon=-60, urcrnrlon=-40, llcrnrlat=-85, urcrnrlat=-75, projection='cyl', resolution='c', fix_aspect=True) |
---|
539 | m.drawcoastlines(linewidth = 1) |
---|
540 | m.drawparallels(np.arange(-85., 75., 2)) |
---|
541 | m.drawmeridians(np.arange(-60., -40., 2)) |
---|
542 | #m.fillcontinents() |
---|
543 | clevs = arange(-25., 5., 0.1) |
---|
544 | xii,yii = m(*np.meshgrid(lonch17_JUN, latch17_JUN)) |
---|
545 | cs = m.contourf(xii, yii, tbch17_anom_JUN[:,:,ijr], clevs, cmap=cm.s3pcpn_l_r) |
---|
546 | cbar = colorbar(cs) |
---|
547 | cbar.set_label('Tb anomaly SSMIS CH17 - JUNE') |
---|
548 | xticks(np.arange(-60., -40., 2)) |
---|
549 | yticks(np.arange(-85., 75., 2)) |
---|
550 | plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/SSMIS/mean_tb_anomaly_map_'+str(ijr+1)+'JUN_ch17_SSMIS_Zoom_zone2') |
---|
551 | |
---|
552 | |
---|
553 | figure() |
---|
554 | plt.ion() |
---|
555 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
556 | m.drawcoastlines(linewidth = 1) |
---|
557 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
558 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
559 | #m.fillcontinents() |
---|
560 | xii,yii = m(*np.meshgrid(lonch17_FEB, latch17_FEB)) |
---|
561 | plt.xticks(arange(-180, 200, 20)) |
---|
562 | plt.yticks(arange(-90, -30, 20)) |
---|
563 | ## ch17 ## |
---|
564 | clevs = arange(150., 270., 1.) |
---|
565 | cs = m.contourf(xii, yii, mean_outzch17_FEB, clevs, cmap=cm.s3pcpn_l_r) |
---|
566 | cbar = colorbar(cs) |
---|
567 | cbar.set_label('Mean Tb FEB [CH17] - SSMIS') |
---|
568 | ## BIAIS ch17-ch18 ## |
---|
569 | biais_JUN = mean_outzch17_JUN - mean_outzch18_JUN |
---|
570 | clevs = arange(0., 45., 1.) |
---|
571 | cs = m.contourf(xii, yii, biais_JUN, clevs, cmap=cm.s3pcpn_l_r) |
---|
572 | cbar = colorbar(cs) |
---|
573 | cbar.set_label('Bias [CH17-CH18] of Mean Tb JUNE - SSMIS') |
---|
574 | |
---|
575 | ## VARIANCE ch17 - ch18 ## |
---|
576 | std1 = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float) |
---|
577 | for ilat in range (0, len(latch17_JUN)): |
---|
578 | for ilon in range (0, len(lonch17_JUN)): |
---|
579 | std1[ilat, ilon] = (mean_outzch17_JUN[ilat, ilon]**2)-(mean_outzch18_JUN[ilat, ilon]**2) |
---|
580 | |
---|
581 | |
---|
582 | N = len(lonch17_JUN)*len(latch17_JUN) |
---|
583 | std_JUN = std1/N |
---|
584 | clevs = arange(0., 25., 0.1) |
---|
585 | cs = m.contourf(xii, yii, std_JUN, clevs, cmap=cm.s3pcpn_l_r) |
---|
586 | cbar = colorbar(cs) |
---|
587 | cbar.set_label('Stantard deviation [CH17-CH18] of Mean Tb JUNE - SSMIS') |
---|
588 | |
---|
589 | |
---|
590 | |
---|
591 | ########################## |
---|
592 | # DIAGRAMME DE HOVMOLLER # |
---|
593 | ########################## |
---|
594 | # shape(tbch17_anom_JUN) = [ilat, ilon, ijr] |
---|
595 | ## FEBRUARY ## |
---|
596 | bbtranche17_FEB = nonzero((latch17_FEB >= -85.) & (latch17_FEB <= -75)) |
---|
597 | mean_tbch17_anom_FEB = np.zeros([len(lonch17_FEB), 28], float) |
---|
598 | for ilon in range (0, len(lonch17_FEB)): |
---|
599 | for ijr in range (0,28): |
---|
600 | mean_tbch17_anom_FEB[ilon,ijr] = mean(tbch17_anom_FEB[bbtranche17_FEB][:,ilon,ijr]) |
---|
601 | |
---|
602 | y_time, x_space = np.meshgrid(arange(0,28,1), lonch17_FEB) |
---|
603 | fig = plt.figure() |
---|
604 | plt.pcolor(x_space, y_time, mean_tbch17_anom_FEB, cmap=cm.s3pcpn_l_r, vmin = -10., vmax = 15.) |
---|
605 | plt.axis([-180., 180., 0, 28]) |
---|
606 | cb = plt.colorbar() |
---|
607 | cb.set_label('Tb anomaly - SSMIS CH17') |
---|
608 | plt.xticks(arange(-180.,200.,40)) |
---|
609 | plt.yticks(arange(0, 28, 1), arange (1, 29, 1)) |
---|
610 | plt.xlabel('longitude') |
---|
611 | plt.ylabel('FEBRUARY 2010') |
---|
612 | |
---|
613 | ## MAY ## |
---|
614 | bbtranche17_MAY = nonzero((latch17_MAY >= -85.) & (latch17_MAY <= -75)) |
---|
615 | mean_tbch17_anom_MAY = np.zeros([len(lonch17_MAY), 31], float) |
---|
616 | for ilon in range (0, len(lonch17_MAY)): |
---|
617 | for ijr in range (0,31): |
---|
618 | mean_tbch17_anom_MAY[ilon,ijr] = mean(tbch17_anom_MAY[bbtranche17_MAY][:,ilon,ijr]) |
---|
619 | |
---|
620 | y_time, x_space = np.meshgrid(arange(0,31,1), lonch17_MAY) |
---|
621 | fig = plt.figure() |
---|
622 | plt.pcolor(x_space, y_time, mean_tbch17_anom_MAY, cmap=cm.s3pcpn_l_r, vmin = -12., vmax = 25.) |
---|
623 | plt.axis([-180., 180., 0, 30]) |
---|
624 | cb = plt.colorbar() |
---|
625 | cb.set_label('Tb anomaly - SSMIS CH17') |
---|
626 | plt.xticks(arange(-180.,200.,40)) |
---|
627 | plt.yticks(arange(0, 30, 1), arange(1,31,1)) |
---|
628 | plt.xlabel('longitude') |
---|
629 | plt.ylabel('MAY 2010') |
---|
630 | |
---|
631 | ## JUNE ## |
---|
632 | bbtranche17_JUN = nonzero((latch17_JUN >= -85.) & (latch17_JUN <= -75)) |
---|
633 | mean_tbch17_anom_JUN = np.zeros([len(lonch17_JUN), 30], float) |
---|
634 | for ilon in range (0, len(lonch17_JUN)): |
---|
635 | for ijr in range (0,30): |
---|
636 | mean_tbch17_anom_JUN[ilon,ijr] = tbch17_anom_JUN[bbtranche17_JUN][:,ilon,ijr].mean() |
---|
637 | |
---|
638 | |
---|
639 | y_time, x_space = np.meshgrid(arange(0,30,1), lonch17_APR) |
---|
640 | fig = plt.figure() |
---|
641 | plt.pcolor(x_space, y_time, mean_tbch17_anom_APR, cmap=cm.s3pcpn_l_r, vmin = -30., vmax = 25.) |
---|
642 | plt.axis([-180., 180., 0, 29]) |
---|
643 | cb = plt.colorbar() |
---|
644 | cb.set_label('Tb anomaly - SSMIS CH17') |
---|
645 | plt.xticks(arange(-180.,220.,40)) |
---|
646 | plt.yticks(arange(0, 30, 1), arange(1,31,1)) |
---|
647 | plt.xlabel('longitude') |
---|
648 | plt.ylabel('JUNE 2010') |
---|
649 | |
---|