source: trunk/src/scripts_Laura/diff_frequ_AMSUA_test.py @ 55

Last change on this file since 55 was 27, checked in by lahlod, 10 years ago

modifs

File size: 21.0 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3import string
4import numpy as np
5import matplotlib.pyplot as plt
6from pylab import *
7from mpl_toolkits.basemap import Basemap
8from mpl_toolkits.basemap import shiftgrid, cm
9from netCDF4 import Dataset
10import ffgrid2
11
12
13len_month = np.array([31, 28, 31, 30, 31, 30, 31])
14month = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
15chan = np.array(['CH1', 'CH15'])
16################
17# CARTOGRAPHIE #
18################
19## Etude sur l'Antarctique ##
20dx = 5.
21dy = 5.
22x0, x1 = -180, 180
23y0, y1 = -90, -30
24
25
26## JANUARY ##
27imo = 0
28## ch1 ##
29fovZen_ch1_JAN = np.where(fov1_JAN == 21.)
30bbemis_ch1_JAN = nonzero((emis1_JAN[fovZen_ch1_JAN] != -500.) & (emis1_JAN[fovZen_ch1_JAN] <= 1.))
31OUTZCH1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
32outzch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
33lonch1_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
34latch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
35## ch15 ##
36fovZen_ch15_JAN = np.where(fov15_JAN == 21.)
37bbemis_ch15_JAN = nonzero((emis15_JAN[fovZen_ch15_JAN] != -500.) & (emis15_JAN[fovZen_ch15_JAN] <= 1.))
38OUTZCH15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
39outzch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
40lonch15_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
41latch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
42for 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
69OUTZ_JAN = np.array([OUTZCH1_JAN, OUTZCH15_JAN])
70
71
72## FEBRUARY ##
73imo = 1
74## ch1 ##
75fovZen_ch1_FEB = np.where(fov1_FEB == 21.)
76bbemis_ch1_FEB = nonzero((emis1_FEB[fovZen_ch1_FEB] != -500.) & (emis1_FEB[fovZen_ch1_FEB] <= 1.))
77OUTZCH1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
78outzch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
79lonch1_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float)
80latch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float)
81## ch15 ##
82fovZen_ch15_FEB = np.where(fov15_FEB == 21.)
83bbemis_ch15_FEB = nonzero((emis15_FEB[fovZen_ch15_FEB] != -500.) & (emis15_FEB[fovZen_ch15_FEB] <= 1.))
84OUTZCH15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
85outzch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
86lonch15_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float)
87latch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float)
88for 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
117OUTZ_FEB = np.array([OUTZCH1_FEB, OUTZCH15_FEB])
118
119## MARCH ##
120imo = 2
121## ch1 ##
122fovZen_ch1_MAR = np.where(fov1_MAR == 21.)
123bbemis_ch1_MAR = nonzero((emis1_MAR[fovZen_ch1_MAR] != -500.) & (emis1_MAR[fovZen_ch1_MAR] <= 1.))
124OUTZCH1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
125outzch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
126lonch1_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
127latch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
128## ch15 ##
129fovZen_ch15_MAR = np.where(fov15_MAR == 21.)
130bbemis_ch15_MAR = nonzero((emis15_MAR[fovZen_ch15_MAR] != -500.) & (emis15_MAR[fovZen_ch15_MAR] <= 1.))
131OUTZCH15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
132outzch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
133lonch15_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
134latch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
135for 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
162OUTZ_MAR = np.array([OUTZCH1_MAR, OUTZCH15_MAR])
163
164
165## APRIL ##
166imo = 3
167## ch1 ##
168fovZen_ch1_APR = np.where(fov1_APR == 21.)
169bbemis_ch1_APR = nonzero((emis1_APR[fovZen_ch1_APR] != -500.) & (emis1_APR[fovZen_ch1_APR] <= 1.))
170OUTZCH1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
171outzch1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
172lonch1_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
173latch1_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
174## ch15 ##
175fovZen_ch15_APR = np.where(fov15_APR == 21.)
176bbemis_ch15_APR = nonzero((emis15_APR[fovZen_ch15_APR] != -500.) & (emis15_APR[fovZen_ch15_APR] <= 1.))
177OUTZCH15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
178outzch15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
179lonch15_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
180latch15_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
181for 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
209OUTZ_APR = np.array([OUTZCH1_APR, OUTZCH15_APR])
210
211## MAY ##
212imo = 4
213## ch1 ##
214fovZen_ch1_MAY = np.where(fov1_MAY == 21.)
215bbemis_ch1_MAY = nonzero((emis1_MAY[fovZen_ch1_MAY] != -500.) & (emis1_MAY[fovZen_ch1_MAY] <= 1.))
216OUTZCH1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
217outzch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
218lonch1_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float)
219latch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float)
220## ch15 ##
221fovZen_ch15_MAY = np.where(fov15_MAY == 21.)
222bbemis_ch15_MAY = nonzero((emis15_MAY[fovZen_ch15_MAY] != -500.) & (emis15_MAY[fovZen_ch15_MAY] <= 1.))
223OUTZCH15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
224outzch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
225lonch15_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float)
226latch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float)
227for 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
254OUTZ_MAY = np.array([OUTZCH1_MAY, OUTZCH15_MAY])
255
256
257## JUNE ##
258imo = 5
259## ch1 ##
260fovZen_ch1_JUN = np.where(fov1_JUN == 21.)
261bbemis_ch1_JUN = nonzero((emis1_JUN[fovZen_ch1_JUN] != -500.) & (emis1_JUN[fovZen_ch1_JUN] <= 1.))
262OUTZCH1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
263outzch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
264lonch1_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
265latch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
266## ch15 ##
267fovZen_ch15_JUN = np.where(fov15_JUN == 21.)
268bbemis_ch15_JUN = nonzero((emis15_JUN[fovZen_ch15_JUN] != -500.) & (emis15_JUN[fovZen_ch15_JUN] <= 1.))
269OUTZCH15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
270outzch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
271lonch15_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
272latch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
273for 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
300OUTZ_JUN = np.array([OUTZCH1_JUN, OUTZCH15_JUN])
301
302
303## JULY ##
304imo = 6
305## ch1 ##
306fovZen_ch1_JUL = np.where(fov1_JUL == 21.)
307bbemis_ch1_JUL = nonzero((emis1_JUL[fovZen_ch1_JUL] != -500.) & (emis1_JUL[fovZen_ch1_JUL] <= 1.))
308OUTZCH1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
309outzch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
310lonch1_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float)
311latch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float)
312## ch15 ##
313fovZen_ch15_JUL = np.where(fov15_JUL == 21.)
314bbemis_ch15_JUL = nonzero((emis15_JUL[fovZen_ch15_JUL] != -500.) & (emis15_JUL[fovZen_ch15_JUL] <= 1.))
315OUTZCH15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
316outzch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
317lonch15_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float)
318latch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float)
319for 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
346OUTZ_JUL = np.array([OUTZCH1_JUL, OUTZCH15_JUL])
347
348
349################################################
350## calcul de la climatologie moyenne par mois ##
351################################################
352lon = lonch1_FEB
353lat = latch1_FEB
354## JANUARY ##
355mean_outz_JAN = np.zeros([len(chan), len(lat), len(lon)], float)
356for 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 ##
362mean_outz_FEB = np.zeros([len(chan), len(lat), len(lon)], float)
363for 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 ##
369mean_outz_MAR = np.zeros([len(chan), len(lat), len(lon)], float)
370for 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 ##
376mean_outz_APR = np.zeros([len(chan), len(lat), len(lon)], float)
377for 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 ##
383mean_outz_MAY = np.zeros([len(chan), len(lat), len(lon)], float)
384for 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 ##
390mean_outz_JUN = np.zeros([len(chan), len(lat), len(lon)], float)
391for 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 ##
397mean_outz_JUL = np.zeros([len(chan), len(lat), len(lon)], float)
398for 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
404mean_outz1 = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL])
405mean_outz2 = np.array([mean_outz_JAN, mean_outz_MAR, mean_outz_MAY, mean_outz_JUN])
406
407
408
409month_red = np.array(['JANUARY', 'MARCH', 'MAY', 'JUNE'])
410for 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 ##
432imo = 1
433### VARIANCE ##
434var = np.zeros([len(chan), len(lat), len(lon)], float)
435for 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
440var_FEB = var / len_month[imo]
441
442## APRIL ##
443imo = 3
444### VARIANCE ##
445var = np.zeros([len(chan), len(lat), len(lon)], float)
446for 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
451var_APR = var / len_month[imo]
452
453## JULY ##
454imo = 6
455### VARIANCE ##
456var = np.zeros([len(chan), len(lat), len(lon)], float)
457for 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
462var_JUL = var / len_month[imo]
463
464
465
466
467plt.figure()
468plt.ion()
469#plt.subplot(2, 1, 1)
470m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True)
471m.drawcoastlines(linewidth = 1)
472m.drawparallels(np.arange(-90., -30., 20))
473m.drawmeridians(np.arange(-180., 180., 20))
474xii,yii = m(*np.meshgrid(lon, lat))
475clevs = (arange(0.5, 0.9, 0.001))
476cs = m.contourf(xii, yii, OUTZ_JAN[0, :, :,20], clevs, cmap=cm.s3pcpn_l_r)
477cbar = colorbar(cs)
478cbar.set_label('CH1 - 23.8GHz')
479plt.title('var(emis) JUL - AMSUA')
480xticks(arange(-180, 200, 20), rotation = 45)
481yticks(arange(-90, -10, 20))
482plt.subplot(2, 1, 2)
483m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True)
484m.drawcoastlines(linewidth = 1)
485m.drawparallels(np.arange(-90., -30., 20))
486m.drawmeridians(np.arange(-180., 180., 20))
487xii,yii = m(*np.meshgrid(lon, lat))
488clevs = (arange(0., 0.0035, 0.00001))
489cs = m.contourf(xii, yii, var_JUL[1, :, :], clevs, cmap=cm.s3pcpn_l_r)
490cbar = colorbar(cs)
491cbar.set_label('CH15 - 89GHz')
492xticks(arange(-180, 200, 20), rotation = 45)
493yticks(arange(-90, -10, 20))
494
495
496
497
498
Note: See TracBrowser for help on using the repository browser.