[22] | 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([28, 30, 31]) |
---|
| 14 | month = np.array(['FEBRUARY', 'APRIL', 'JULY']) |
---|
| 15 | ################ |
---|
| 16 | # CARTOGRAPHIE # |
---|
| 17 | ################ |
---|
| 18 | ## Etude sur l'Antarctique ## |
---|
| 19 | dx = 5. |
---|
| 20 | dy = 5. |
---|
| 21 | x0, x1 = -180, 180 |
---|
| 22 | y0, y1 = -90, -30 |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | ## FEBRUARY ## |
---|
| 26 | imo = 0 |
---|
| 27 | ## ch12 ## |
---|
| 28 | bbemis_ch12_FEB = nonzero((emis12_FEB != -500.) & (emis12_FEB <= 1.)) |
---|
| 29 | OUTZCH12_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 30 | outzch12_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 31 | lonch12_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 32 | latch12_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 33 | ## ch13 ## |
---|
| 34 | bbemis_ch13_FEB = nonzero((emis13_FEB != -500.) & (emis13_FEB <= 1.)) |
---|
| 35 | OUTZCH13_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 36 | outzch13_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 37 | lonch13_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 38 | latch13_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[23] | 39 | ## ch17 ## |
---|
| 40 | bbemis_ch17_FEB = nonzero((emis17_FEB != -500.) & (emis17_FEB <= 1.)) |
---|
| 41 | OUTZCH17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 42 | outzch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 43 | lonch17_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 44 | latch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 45 | ## ch18 ## |
---|
| 46 | bbemis_ch18_FEB = nonzero((emis18_FEB != -500.) & (emis18_FEB <= 1.)) |
---|
| 47 | OUTZCH18_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 48 | outzch18_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 49 | lonch18_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 50 | latch18_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[22] | 51 | for ijr in range (0, len_month[imo]): |
---|
| 52 | print 'jour=', ijr+1 |
---|
[23] | 53 | ## ch17 ## |
---|
| 54 | ind_jr17_FEB = np.where(jjr17_FEB[bbemis_ch17_FEB] == ijr+1)[0] |
---|
| 55 | xx = lon17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] |
---|
| 56 | yy = lat17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] |
---|
| 57 | zz = emis17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] |
---|
| 58 | zz0 = min(zz) |
---|
| 59 | zz1 = max(zz) |
---|
| 60 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 61 | outzch17_FEB = outz |
---|
| 62 | lonch17_FEB = outx |
---|
| 63 | latch17_FEB = outy |
---|
| 64 | OUTZCH17_FEB[:,:,ijr] = outzch17_FEB[:,:] |
---|
| 65 | ## ch18 ## |
---|
| 66 | ind_jr18_FEB = np.where(jjr18_FEB[bbemis_ch18_FEB] == ijr+1)[0] |
---|
| 67 | xx = lon18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] |
---|
| 68 | yy = lat18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] |
---|
| 69 | zz = emis18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] |
---|
| 70 | zz0 = min(zz) |
---|
| 71 | zz1 = max(zz) |
---|
| 72 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 73 | outzch18_FEB = outz |
---|
| 74 | lonch18_FEB = outx |
---|
| 75 | latch18_FEB = outy |
---|
| 76 | OUTZCH18_FEB[:,:,ijr] = outzch18_FEB[:,:] |
---|
[22] | 77 | ## ch12 ## |
---|
| 78 | ind_jr12_FEB = np.where(jjr12_FEB[bbemis_ch12_FEB] == ijr+1)[0] |
---|
| 79 | xx = lon12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] |
---|
| 80 | yy = lat12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] |
---|
| 81 | zz = emis12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] |
---|
| 82 | zz0 = min(zz) |
---|
| 83 | zz1 = max(zz) |
---|
| 84 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 85 | outzch12_FEB = outz |
---|
| 86 | lonch12_FEB = outx |
---|
| 87 | latch12_FEB = outy |
---|
| 88 | OUTZCH12_FEB[:,:,ijr] = outzch12_FEB[:,:] |
---|
| 89 | ## ch13 ## |
---|
| 90 | ind_jr13_FEB = np.where(jjr13_FEB[bbemis_ch13_FEB] == ijr+1)[0] |
---|
| 91 | xx = lon13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] |
---|
| 92 | yy = lat13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] |
---|
| 93 | zz = emis13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] |
---|
| 94 | zz0 = min(zz) |
---|
| 95 | zz1 = max(zz) |
---|
| 96 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 97 | outzch13_FEB = outz |
---|
| 98 | lonch13_FEB = outx |
---|
| 99 | latch13_FEB = outy |
---|
| 100 | OUTZCH13_FEB[:,:,ijr] = outzch13_FEB[:,:] |
---|
| 101 | |
---|
| 102 | ## APRIL ## |
---|
| 103 | imo = 1 |
---|
| 104 | ## ch12 ## |
---|
| 105 | bbemis_ch12_APR = nonzero((emis12_APR != -500.) & (emis12_APR <= 1.)) |
---|
| 106 | OUTZCH12_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 107 | outzch12_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 108 | lonch12_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 109 | latch12_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 110 | ## ch13 ## |
---|
| 111 | bbemis_ch13_APR = nonzero((emis13_APR != -500.) & (emis13_APR <= 1.)) |
---|
| 112 | OUTZCH13_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 113 | outzch13_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 114 | lonch13_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 115 | latch13_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[23] | 116 | ## ch17 ## |
---|
| 117 | bbemis_ch17_APR = nonzero((emis17_APR != -500.) & (emis17_APR <= 1.)) |
---|
| 118 | OUTZCH17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 119 | outzch17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 120 | lonch17_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 121 | latch17_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 122 | ## ch18 ## |
---|
| 123 | bbemis_ch18_APR = nonzero((emis18_APR != -500.) & (emis18_APR <= 1.)) |
---|
| 124 | OUTZCH18_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 125 | outzch18_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 126 | lonch18_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 127 | latch18_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[22] | 128 | for ijr in range (0, len_month[imo]): |
---|
| 129 | print 'jour=', ijr+1 |
---|
[23] | 130 | ## ch17 ## |
---|
| 131 | ind_jr17_APR = np.where(jjr17_APR[bbemis_ch17_APR] == ijr+1)[0] |
---|
| 132 | xx = lon17_APR[bbemis_ch17_APR][ind_jr17_APR] |
---|
| 133 | yy = lat17_APR[bbemis_ch17_APR][ind_jr17_APR] |
---|
| 134 | zz = emis17_APR[bbemis_ch17_APR][ind_jr17_APR] |
---|
| 135 | zz0 = min(zz) |
---|
| 136 | zz1 = max(zz) |
---|
| 137 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 138 | outzch17_APR = outz |
---|
| 139 | lonch17_APR = outx |
---|
| 140 | latch17_APR = outy |
---|
| 141 | OUTZCH17_APR[:,:,ijr] = outzch17_APR[:,:] |
---|
| 142 | ## ch18 ## |
---|
| 143 | ind_jr18_APR = np.where(jjr18_APR[bbemis_ch18_APR] == ijr+1)[0] |
---|
| 144 | xx = lon18_APR[bbemis_ch18_APR][ind_jr18_APR] |
---|
| 145 | yy = lat18_APR[bbemis_ch18_APR][ind_jr18_APR] |
---|
| 146 | zz = emis18_APR[bbemis_ch18_APR][ind_jr18_APR] |
---|
| 147 | zz0 = min(zz) |
---|
| 148 | zz1 = max(zz) |
---|
| 149 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 150 | outzch18_APR = outz |
---|
| 151 | lonch18_APR = outx |
---|
| 152 | latch18_APR = outy |
---|
| 153 | OUTZCH18_APR[:,:,ijr] = outzch18_APR[:,:] |
---|
[22] | 154 | ## ch12 ## |
---|
| 155 | ind_jr12_APR = np.where(jjr12_APR[bbemis_ch12_APR] == ijr+1)[0] |
---|
| 156 | xx = lon12_APR[bbemis_ch12_APR][ind_jr12_APR] |
---|
| 157 | yy = lat12_APR[bbemis_ch12_APR][ind_jr12_APR] |
---|
| 158 | zz = emis12_APR[bbemis_ch12_APR][ind_jr12_APR] |
---|
| 159 | zz0 = min(zz) |
---|
| 160 | zz1 = max(zz) |
---|
| 161 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 162 | outzch12_APR = outz |
---|
| 163 | lonch12_APR = outx |
---|
| 164 | latch12_APR = outy |
---|
[23] | 165 | OUTZCH12_APR[:,:,ijr] = outzch12_APR[:,:] |
---|
[22] | 166 | ## ch13 ## |
---|
| 167 | ind_jr13_APR = np.where(jjr13_APR[bbemis_ch13_APR] == ijr+1)[0] |
---|
| 168 | xx = lon13_APR[bbemis_ch13_APR][ind_jr13_APR] |
---|
| 169 | yy = lat13_APR[bbemis_ch13_APR][ind_jr13_APR] |
---|
| 170 | zz = emis13_APR[bbemis_ch13_APR][ind_jr13_APR] |
---|
| 171 | zz0 = min(zz) |
---|
| 172 | zz1 = max(zz) |
---|
| 173 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 174 | outzch13_APR = outz |
---|
| 175 | lonch13_APR = outx |
---|
| 176 | latch13_APR = outy |
---|
| 177 | OUTZCH13_APR[:,:,ijr] = outzch13_APR[:,:] |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | ## JULY ## |
---|
| 183 | imo = 2 |
---|
| 184 | ## ch12 ## |
---|
| 185 | bbemis_ch12_JUL = nonzero((emis12_JUL != -500.) & (emis12_JUL <= 1.)) |
---|
| 186 | OUTZCH12_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 187 | outzch12_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 188 | lonch12_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 189 | latch12_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 190 | ## ch13 ## |
---|
| 191 | bbemis_ch13_JUL = nonzero((emis13_JUL != -500.) & (emis13_JUL <= 1.)) |
---|
| 192 | OUTZCH13_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 193 | outzch13_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 194 | lonch13_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 195 | latch13_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[23] | 196 | ## ch17 ## |
---|
| 197 | bbemis_ch17_JUL = nonzero((emis17_JUL != -500.) & (emis17_JUL <= 1.)) |
---|
| 198 | OUTZCH17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 199 | outzch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 200 | lonch17_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 201 | latch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
| 202 | ## ch18 ## |
---|
| 203 | bbemis_ch18_JUL = nonzero((emis18_JUL != -500.) & (emis18_JUL <= 1.)) |
---|
| 204 | OUTZCH18_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) |
---|
| 205 | outzch18_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) |
---|
| 206 | lonch18_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) |
---|
| 207 | latch18_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) |
---|
[22] | 208 | for ijr in range (0, len_month[imo]): |
---|
| 209 | print 'jour=', ijr+1 |
---|
[23] | 210 | ## ch17 ## |
---|
| 211 | ind_jr17_JUL = np.where(jjr17_JUL[bbemis_ch17_JUL] == ijr+1)[0] |
---|
| 212 | xx = lon17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] |
---|
| 213 | yy = lat17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] |
---|
| 214 | zz = emis17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] |
---|
| 215 | zz0 = min(zz) |
---|
| 216 | zz1 = max(zz) |
---|
| 217 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 218 | outzch17_JUL = outz |
---|
| 219 | lonch17_JUL = outx |
---|
| 220 | latch17_JUL = outy |
---|
| 221 | OUTZCH17_JUL[:,:,ijr] = outzch17_JUL[:,:] |
---|
| 222 | ## ch18 ## |
---|
| 223 | ind_jr18_JUL = np.where(jjr18_JUL[bbemis_ch18_JUL] == ijr+1)[0] |
---|
| 224 | xx = lon18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] |
---|
| 225 | yy = lat18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] |
---|
| 226 | zz = emis18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] |
---|
| 227 | zz0 = min(zz) |
---|
| 228 | zz1 = max(zz) |
---|
| 229 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 230 | outzch18_JUL = outz |
---|
| 231 | lonch18_JUL = outx |
---|
| 232 | latch18_JUL = outy |
---|
| 233 | OUTZCH18_JUL[:,:,ijr] = outzch18_JUL[:,:] |
---|
[22] | 234 | ## ch12 ## |
---|
| 235 | ind_jr12_JUL = np.where(jjr12_JUL[bbemis_ch12_JUL] == ijr+1)[0] |
---|
| 236 | xx = lon12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] |
---|
| 237 | yy = lat12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] |
---|
| 238 | zz = emis12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] |
---|
| 239 | zz0 = min(zz) |
---|
| 240 | zz1 = max(zz) |
---|
| 241 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 242 | outzch12_JUL = outz |
---|
| 243 | lonch12_JUL = outx |
---|
| 244 | latch12_JUL = outy |
---|
| 245 | OUTZCH12_JUL[:,:,ijr] = outzch12_JUL[:,:] |
---|
| 246 | ## ch13 ## |
---|
| 247 | ind_jr13_JUL = np.where(jjr13_JUL[bbemis_ch13_JUL] == ijr+1)[0] |
---|
| 248 | xx = lon13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] |
---|
[23] | 249 | yy = lat13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] |
---|
[22] | 250 | zz = emis13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] |
---|
| 251 | zz0 = min(zz) |
---|
| 252 | zz1 = max(zz) |
---|
| 253 | outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) |
---|
| 254 | outzch13_JUL = outz |
---|
| 255 | lonch13_JUL = outx |
---|
| 256 | latch13_JUL = outy |
---|
| 257 | OUTZCH13_JUL[:,:,ijr] = outzch13_JUL[:,:] |
---|
| 258 | |
---|
| 259 | |
---|
[23] | 260 | ################################################ |
---|
| 261 | ## calcul de la climatologie moyenne par mois ## |
---|
| 262 | ################################################ |
---|
[22] | 263 | |
---|
[23] | 264 | lon = lonch12_FEB = lonch12_APR = lonch12_JUL = lonch13_FEB = lonch13_APR = lonch13_JUL |
---|
| 265 | lat = latch12_FEB = latch12_APR = latch12_JUL = latch13_FEB = latch13_APR = latch13_JUL |
---|
| 266 | #lon = lonch17_FEB = lonch17_APR = lonch17_JUL = lonch18_FEB = lonch18_APR = lonch18_JUL |
---|
| 267 | #lat = latch17_FEB = latch17_APR = latch17_JUL = latch18_FEB = latch18_APR = latch18_JUL |
---|
| 268 | |
---|
[22] | 269 | ## FEBRUARY ## |
---|
| 270 | ## ch12 ## |
---|
[23] | 271 | mean_outzch12_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 272 | for ilon in range (0, len(lon)): |
---|
| 273 | for ilat in range (0, len(lat)): |
---|
[22] | 274 | mean_outzch12_FEB[ilat, ilon] = mean(OUTZCH12_FEB[ilat, ilon, :]) |
---|
| 275 | |
---|
| 276 | ## ch13 ## |
---|
[23] | 277 | mean_outzch13_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 278 | for ilon in range (0, len(lon)): |
---|
| 279 | for ilat in range (0, len(lat)): |
---|
[22] | 280 | mean_outzch13_FEB[ilat, ilon] = mean(OUTZCH13_FEB[ilat, ilon, :]) |
---|
| 281 | |
---|
[23] | 282 | ## ch17 ## |
---|
| 283 | mean_outzch17_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 284 | for ilon in range (0, len(lon)): |
---|
| 285 | for ilat in range (0, len(lat)): |
---|
| 286 | mean_outzch17_FEB[ilat, ilon] = mean(OUTZCH17_FEB[ilat, ilon, :]) |
---|
[22] | 287 | |
---|
[23] | 288 | ## ch18 ## |
---|
| 289 | mean_outzch18_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 290 | for ilon in range (0, len(lon)): |
---|
| 291 | for ilat in range (0, len(lat)): |
---|
| 292 | mean_outzch18_FEB[ilat, ilon] = mean(OUTZCH18_FEB[ilat, ilon, :]) |
---|
| 293 | |
---|
| 294 | |
---|
[22] | 295 | ## APRIL ## |
---|
| 296 | ## ch12 ## |
---|
[23] | 297 | mean_outzch12_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 298 | for ilon in range (0, len(lon)): |
---|
| 299 | for ilat in range (0, len(lat)): |
---|
[22] | 300 | mean_outzch12_APR[ilat, ilon] = mean(OUTZCH12_APR[ilat, ilon, :][nonzero(isnan(OUTZCH12_APR[ilat, ilon, :]) == False)]) |
---|
| 301 | |
---|
| 302 | ## ch13 ## |
---|
[23] | 303 | mean_outzch13_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 304 | for ilon in range (0, len(lon)): |
---|
| 305 | for ilat in range (0, len(lat)): |
---|
[22] | 306 | mean_outzch13_APR[ilat, ilon] = mean(OUTZCH13_APR[ilat, ilon, :][nonzero(isnan(OUTZCH13_APR[ilat, ilon, :]) == False)]) |
---|
| 307 | |
---|
[23] | 308 | ## ch17 ## |
---|
| 309 | mean_outzch17_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 310 | for ilon in range (0, len(lon)): |
---|
| 311 | for ilat in range (0, len(lat)): |
---|
| 312 | mean_outzch17_APR[ilat, ilon] = mean(OUTZCH17_APR[ilat, ilon, :][nonzero(isnan(OUTZCH17_APR[ilat, ilon, :]) == False)]) |
---|
[22] | 313 | |
---|
[23] | 314 | ## ch18 ## |
---|
| 315 | mean_outzch18_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 316 | for ilon in range (0, len(lon)): |
---|
| 317 | for ilat in range (0, len(lat)): |
---|
| 318 | mean_outzch18_APR[ilat, ilon] = mean(OUTZCH18_APR[ilat, ilon, :][nonzero(isnan(OUTZCH18_APR[ilat, ilon, :]) == False)]) |
---|
[22] | 319 | |
---|
[23] | 320 | |
---|
| 321 | |
---|
[22] | 322 | ## JULY ## |
---|
| 323 | ## ch12 ## |
---|
[23] | 324 | mean_outzch12_JUL = np.zeros([len(lat), len(lon)], float) |
---|
| 325 | for ilon in range (0, len(lon)): |
---|
| 326 | for ilat in range (0, len(lat)): |
---|
[22] | 327 | mean_outzch12_JUL[ilat, ilon] = mean(OUTZCH12_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH12_JUL[ilat, ilon, :]) == False)]) |
---|
| 328 | |
---|
| 329 | ## ch13 ## |
---|
[23] | 330 | mean_outzch13_JUL = np.zeros([len(lat), len(lon)], float) |
---|
| 331 | for ilon in range (0, len(lon)): |
---|
| 332 | for ilat in range (0, len(lat)): |
---|
[22] | 333 | mean_outzch13_JUL[ilat, ilon] = mean(OUTZCH13_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH13_JUL[ilat, ilon, :]) == False)]) |
---|
| 334 | |
---|
[23] | 335 | ## ch17 ## |
---|
| 336 | mean_outzch17_JUL = np.zeros([len(lat), len(lon)], float) |
---|
| 337 | for ilon in range (0, len(lon)): |
---|
| 338 | for ilat in range (0, len(lat)): |
---|
| 339 | mean_outzch17_JUL[ilat, ilon] = mean(OUTZCH17_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH17_JUL[ilat, ilon, :]) == False)]) |
---|
[22] | 340 | |
---|
[23] | 341 | ## ch18 ## |
---|
| 342 | mean_outzch18_JUL = np.zeros([len(lat), len(lon)], float) |
---|
| 343 | for ilon in range (0, len(lon)): |
---|
| 344 | for ilat in range (0, len(lat)): |
---|
| 345 | mean_outzch18_JUL[ilat, ilon] = mean(OUTZCH18_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH18_JUL[ilat, ilon, :]) == False)]) |
---|
[22] | 346 | |
---|
[23] | 347 | |
---|
| 348 | |
---|
| 349 | ###################### |
---|
| 350 | ## calculs de stats ## |
---|
| 351 | ###################### |
---|
| 352 | |
---|
| 353 | ### VARIANCE - COVARIANCE ## |
---|
| 354 | |
---|
[22] | 355 | ## FEBRUARY ## |
---|
[23] | 356 | imo = 0 |
---|
[22] | 357 | ## ch12 ## |
---|
[23] | 358 | varF12 = np.zeros([len(lat), len(lon)], float) |
---|
| 359 | for ilon in range (0, len(lon)): |
---|
| 360 | for ilat in range (0, len(lat)): |
---|
| 361 | varF12[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])**2) |
---|
| 362 | |
---|
| 363 | var_FEB_12 = varF12 / len_month[imo] |
---|
| 364 | |
---|
[22] | 365 | ## ch13 ## |
---|
[23] | 366 | varF13 = np.zeros([len(lat), len(lon)], float) |
---|
| 367 | for ilon in range (0, len(lon)): |
---|
| 368 | for ilat in range (0, len(lat)): |
---|
| 369 | varF13[ilat, ilon] = np.sum((OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])**2) |
---|
[22] | 370 | |
---|
[23] | 371 | var_FEB_13 = varF13 / len_month[imo] |
---|
[22] | 372 | |
---|
[23] | 373 | ## ch12-ch13 ## |
---|
| 374 | cov_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 375 | for ilon in range (0, len(lon)): |
---|
| 376 | for ilat in range (0, len(lat)): |
---|
| 377 | cov_FEB[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])*(OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])) |
---|
[22] | 378 | |
---|
[23] | 379 | cov_FEB_1213 = cov_FEB / len_month[imo] |
---|
| 380 | |
---|
| 381 | ## ch17 ## |
---|
| 382 | varF17 = np.zeros([len(lat), len(lon)], float) |
---|
| 383 | for ilon in range (0, len(lon)): |
---|
| 384 | for ilat in range (0, len(lat)): |
---|
| 385 | varF17[ilat, ilon] = np.sum((OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])**2) |
---|
| 386 | |
---|
| 387 | var_FEB_17 = varF17 / len_month[imo] |
---|
| 388 | |
---|
| 389 | ## ch18 ## |
---|
| 390 | varF18 = np.zeros([len(lat), len(lon)], float) |
---|
| 391 | for ilon in range (0, len(lon)): |
---|
| 392 | for ilat in range (0, len(lat)): |
---|
| 393 | varF18[ilat, ilon] = np.sum((OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])**2) |
---|
| 394 | |
---|
| 395 | var_FEB_18 = varF18 / len_month[imo] |
---|
| 396 | |
---|
| 397 | ## ch17-ch18 ## |
---|
| 398 | cov_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 399 | for ilon in range (0, len(lon)): |
---|
| 400 | for ilat in range (0, len(lat)): |
---|
| 401 | cov_FEB[ilat, ilon] = np.sum((OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])*(OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])) |
---|
| 402 | |
---|
| 403 | cov_FEB_1718 = cov_FEB / len_month[imo] |
---|
| 404 | |
---|
| 405 | ## ch13-ch17 ## |
---|
| 406 | cov_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 407 | for ilon in range (0, len(lon)): |
---|
| 408 | for ilat in range (0, len(lat)): |
---|
| 409 | cov_FEB[ilat, ilon] = np.sum((OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])*(OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])) |
---|
| 410 | |
---|
| 411 | cov_FEB_1317 = cov_FEB / len_month[imo] |
---|
| 412 | |
---|
| 413 | ## ch12-ch18 ## |
---|
| 414 | cov_FEB = np.zeros([len(lat), len(lon)], float) |
---|
| 415 | for ilon in range (0, len(lon)): |
---|
| 416 | for ilat in range (0, len(lat)): |
---|
| 417 | cov_FEB[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])*(OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])) |
---|
| 418 | |
---|
| 419 | cov_FEB_1218 = cov_FEB / len_month[imo] |
---|
| 420 | |
---|
| 421 | |
---|
| 422 | ## APRIL ## |
---|
| 423 | imo = 1 |
---|
[22] | 424 | ## ch12 ## |
---|
[23] | 425 | varA12 = np.zeros([len(lat), len(lon)], float) |
---|
| 426 | for ilon in range (0, len(lon)): |
---|
| 427 | for ilat in range (0, len(lat)): |
---|
| 428 | varA12[ilat, ilon] = np.sum((OUTZCH12_APR[ilat, ilon, :] - mean_outzch12_APR[ilat, ilon])**2) |
---|
| 429 | |
---|
| 430 | var_APR_12 = varA12 / len_month[imo] |
---|
| 431 | |
---|
[22] | 432 | ## ch13 ## |
---|
[23] | 433 | varA13 = np.zeros([len(lat), len(lon)], float) |
---|
| 434 | for ilon in range (0, len(lon)): |
---|
| 435 | for ilat in range (0, len(lat)): |
---|
| 436 | varA13[ilat, ilon] = np.sum((OUTZCH13_APR[ilat, ilon, :] - mean_outzch13_APR[ilat, ilon])**2) |
---|
[22] | 437 | |
---|
[23] | 438 | var_APR_13 = varA13 / len_month[imo] |
---|
[22] | 439 | |
---|
[23] | 440 | ## ch17 ## |
---|
| 441 | varA17 = np.zeros([len(lat), len(lon)], float) |
---|
| 442 | for ilon in range (0, len(lon)): |
---|
| 443 | for ilat in range (0, len(lat)): |
---|
| 444 | varA17[ilat, ilon] = np.sum((OUTZCH17_APR[ilat, ilon, :] - mean_outzch17_APR[ilat, ilon])**2) |
---|
[22] | 445 | |
---|
[23] | 446 | var_APR_17 = varA17 / len_month[imo] |
---|
| 447 | |
---|
| 448 | ## ch18 ## |
---|
| 449 | varA18 = np.zeros([len(lat), len(lon)], float) |
---|
| 450 | for ilon in range (0, len(lon)): |
---|
| 451 | for ilat in range (0, len(lat)): |
---|
| 452 | varA18[ilat, ilon] = np.sum((OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])**2) |
---|
| 453 | |
---|
| 454 | var_APR_18 = varA18 / len_month[imo] |
---|
| 455 | |
---|
| 456 | ## ch17-ch18 ## |
---|
| 457 | cov_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 458 | for ilon in range (0, len(lon)): |
---|
| 459 | for ilat in range (0, len(lat)): |
---|
| 460 | cov_APR[ilat, ilon] = np.sum((OUTZCH17_APR[ilat, ilon, :] - mean_outzch17_APR[ilat, ilon])*(OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])) |
---|
| 461 | |
---|
| 462 | cov_APR_1718 = cov_APR / len_month[imo] |
---|
| 463 | |
---|
| 464 | ## ch12-ch18 ## |
---|
| 465 | cov_APR = np.zeros([len(lat), len(lon)], float) |
---|
| 466 | for ilon in range (0, len(lon)): |
---|
| 467 | for ilat in range (0, len(lat)): |
---|
| 468 | cov_APR[ilat, ilon] = np.sum((OUTZCH12_APR[ilat, ilon, :] - mean_outzch12_APR[ilat, ilon])*(OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])) |
---|
| 469 | |
---|
| 470 | cov_APR_1218 = cov_APR / len_month[imo] |
---|
| 471 | |
---|
| 472 | |
---|
| 473 | |
---|
| 474 | ## JULY ## |
---|
| 475 | imo = 2 |
---|
| 476 | ## ch17 ## |
---|
| 477 | varJ17 = np.zeros([len(lat), len(lon)], float) |
---|
| 478 | for ilon in range (0, len(lon)): |
---|
| 479 | for ilat in range (0, len(lat)): |
---|
| 480 | varJ17[ilat, ilon] = np.sum((OUTZCH17_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH17_JUL[ilat, ilon, :]) == False)] - mean_outzch17_JUL[ilat, ilon])**2) |
---|
| 481 | |
---|
| 482 | var_JUL_17 = varJ17 / len_month[imo] |
---|
| 483 | |
---|
| 484 | ## ch18 ## |
---|
| 485 | varJ18 = np.zeros([len(lat), len(lon)], float) |
---|
| 486 | for ilon in range (0, len(lon)): |
---|
| 487 | for ilat in range (0, len(lat)): |
---|
| 488 | varJ18[ilat, ilon] = np.sum((OUTZCH18_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH18_JUL[ilat, ilon, :]) == False)] - mean_outzch18_JUL[ilat, ilon])**2) |
---|
| 489 | |
---|
| 490 | var_JUL_18 = varJ18 / len_month[imo] |
---|
| 491 | |
---|
| 492 | ## ch17-ch18 ## |
---|
| 493 | cov_JUL = np.zeros([len(lat), len(lon)], float) |
---|
| 494 | for ilon in range (0, len(lon)): |
---|
| 495 | for ilat in range (0, len(lat)): |
---|
| 496 | cov_JUL[ilat, ilon] = np.sum((OUTZCH17_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH17_JUL[ilat, ilon, :]) == False)] - mean_outzch17_JUL[ilat, ilon]) * (OUTZCH18_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH18_JUL[ilat, ilon, :]) == False)] - mean_outzch18_JUL[ilat, ilon])) |
---|
| 497 | |
---|
| 498 | cov_JUL_1718 = cov_JUL / len_month[imo] |
---|
| 499 | |
---|
| 500 | |
---|
| 501 | plt.ion() |
---|
[22] | 502 | figure() |
---|
| 503 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
| 504 | m.drawcoastlines(linewidth = 1) |
---|
| 505 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
| 506 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
| 507 | xii,yii = m(*np.meshgrid(lon, lat)) |
---|
[23] | 508 | clevs = arange(0., 0.0035, 0.00001) |
---|
| 509 | cs = m.contourf(xii, yii, cov_JUL_1718, clevs, cmap=cm.s3pcpn_l_r) |
---|
[22] | 510 | cbar = colorbar(cs) |
---|
[23] | 511 | cbar.set_label('covar(emis) JUL [CH17-CH18] - SSMIS') |
---|
| 512 | xticks(arange(-180, 200, 20), rotation = 45) |
---|
| 513 | yticks(arange(-90, -10, 20)) |
---|
[22] | 514 | |
---|
| 515 | |
---|
[23] | 516 | ## BIAIS ## |
---|
[22] | 517 | |
---|
| 518 | ## FEBRUARY ## |
---|
[23] | 519 | biais_FEB_polar1 = mean_outzch12_FEB - mean_outzch13_FEB |
---|
| 520 | biais_FEB_polar2 = mean_outzch17_FEB - mean_outzch18_FEB |
---|
| 521 | biais_FEB_freq1 = mean_outzch12_FEB - mean_outzch18_FEB |
---|
| 522 | biais_FEB_freq2 = mean_outzch13_FEB - mean_outzch17_FEB |
---|
[22] | 523 | |
---|
[23] | 524 | ## APRIL ## |
---|
| 525 | biais_APR_polar1 = mean_outzch12_APR - mean_outzch13_APR |
---|
| 526 | biais_APR_polar2 = mean_outzch17_APR - mean_outzch18_APR |
---|
[22] | 527 | |
---|
[23] | 528 | ## JULY ## |
---|
| 529 | biais_JUL_polar1 = mean_outzch12_JUL - mean_outzch13_JUL |
---|
| 530 | biais_JUL_polar2 = mean_outzch17_JUL - mean_outzch18_JUL |
---|
[22] | 531 | |
---|
| 532 | |
---|
| 533 | |
---|
[23] | 534 | figure() |
---|
| 535 | m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) |
---|
| 536 | m.drawcoastlines(linewidth = 1) |
---|
| 537 | m.drawparallels(np.arange(-90., -30., 20)) |
---|
| 538 | m.drawmeridians(np.arange(-180., 180., 20)) |
---|
| 539 | xii,yii = m(*np.meshgrid(lon, lat)) |
---|
| 540 | clevs = arange(-0.24, 0.32, 0.001) |
---|
| 541 | cs = m.contourf(xii, yii, biais_FEB_freq2, clevs, cmap=cm.s3pcpn_l_r) |
---|
| 542 | cbar = colorbar(cs) |
---|
| 543 | cbar.set_label('biais(emis) FEB [CH13-CH17] - SSMIS') |
---|
| 544 | xticks(arange(-180, 200, 20), rotation = 45) |
---|
| 545 | yticks(arange(-90, -10, 20)) |
---|