- Timestamp:
- 06/02/14 18:40:18 (10 years ago)
- Location:
- trunk/src/scripts_Laura
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scripts_Laura/diff_polarsHV_SSMIS_test.py
r22 r23 37 37 lonch13_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) 38 38 latch13_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) 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) 39 51 for ijr in range (0, len_month[imo]): 40 52 print 'jour=', ijr+1 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[:,:] 41 77 ## ch12 ## 42 78 ind_jr12_FEB = np.where(jjr12_FEB[bbemis_ch12_FEB] == ijr+1)[0] … … 78 114 lonch13_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) 79 115 latch13_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) 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) 80 128 for ijr in range (0, len_month[imo]): 81 129 print 'jour=', ijr+1 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[:,:] 82 154 ## ch12 ## 83 155 ind_jr12_APR = np.where(jjr12_APR[bbemis_ch12_APR] == ijr+1)[0] … … 91 163 lonch12_APR = outx 92 164 latch12_APR = outy 93 OUTZCH12_APR[:,:,ijr] = outzch1 3_APR[:,:]165 OUTZCH12_APR[:,:,ijr] = outzch12_APR[:,:] 94 166 ## ch13 ## 95 167 ind_jr13_APR = np.where(jjr13_APR[bbemis_ch13_APR] == ijr+1)[0] … … 122 194 lonch13_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) 123 195 latch13_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) 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) 124 208 for ijr in range (0, len_month[imo]): 125 209 print 'jour=', ijr+1 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[:,:] 126 234 ## ch12 ## 127 235 ind_jr12_JUL = np.where(jjr12_JUL[bbemis_ch12_JUL] == ijr+1)[0] … … 139 247 ind_jr13_JUL = np.where(jjr13_JUL[bbemis_ch13_JUL] == ijr+1)[0] 140 248 xx = lon13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] 141 yy = lat1 2_JUL[bbemis_ch13_JUL][ind_jr13_JUL]249 yy = lat13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] 142 250 zz = emis13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] 143 251 zz0 = min(zz) … … 150 258 151 259 152 ####################################### 153 ## calcul de la climatologie moyenne ## 154 ####################################### 155 156 ## FEBRUARY ## 157 ## ch12 ## 158 mean_outzch12_FEB = np.zeros([len(latch12_FEB), len(lonch12_FEB)], float) 159 for ilon in range (0, len(lonch12_FEB)): 160 for ilat in range (0, len(latch12_FEB)): 161 mean_outzch12_FEB[ilat, ilon] = mean(OUTZCH12_FEB[ilat, ilon, :]) 162 163 ## ch13 ## 164 mean_outzch13_FEB = np.zeros([len(latch13_FEB), len(lonch13_FEB)], float) 165 for ilon in range (0, len(lonch13_FEB)): 166 for ilat in range (0, len(latch13_FEB)): 167 mean_outzch13_FEB[ilat, ilon] = mean(OUTZCH13_FEB[ilat, ilon, :]) 168 169 170 ## APRIL ## 171 ## ch12 ## 172 mean_outzch12_APR = np.zeros([len(latch12_APR), len(lonch12_APR)], float) 173 for ilon in range (0, len(lonch12_APR)): 174 for ilat in range (0, len(latch12_APR)): 175 mean_outzch12_APR[ilat, ilon] = mean(OUTZCH12_APR[ilat, ilon, :][nonzero(isnan(OUTZCH12_APR[ilat, ilon, :]) == False)]) 176 177 ## ch13 ## 178 mean_outzch13_APR = np.zeros([len(latch13_APR), len(lonch13_APR)], float) 179 for ilon in range (0, len(lonch13_APR)): 180 for ilat in range (0, len(latch13_APR)): 181 mean_outzch13_APR[ilat, ilon] = mean(OUTZCH13_APR[ilat, ilon, :][nonzero(isnan(OUTZCH13_APR[ilat, ilon, :]) == False)]) 182 183 184 185 ## JULY ## 186 ## ch12 ## 187 mean_outzch12_JUL = np.zeros([len(latch12_JUL), len(lonch12_JUL)], float) 188 for ilon in range (0, len(lonch12_JUL)): 189 for ilat in range (0, len(latch12_JUL)): 190 mean_outzch12_JUL[ilat, ilon] = mean(OUTZCH12_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH12_JUL[ilat, ilon, :]) == False)]) 191 192 ## ch13 ## 193 mean_outzch13_JUL = np.zeros([len(latch13_JUL), len(lonch13_JUL)], float) 194 for ilon in range (0, len(lonch13_JUL)): 195 for ilat in range (0, len(latch13_JUL)): 196 mean_outzch13_JUL[ilat, ilon] = mean(OUTZCH13_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH13_JUL[ilat, ilon, :]) == False)]) 197 198 199 ################## 200 ## cartographie ## 201 ################## 260 ################################################ 261 ## calcul de la climatologie moyenne par mois ## 262 ################################################ 263 202 264 lon = lonch12_FEB = lonch12_APR = lonch12_JUL = lonch13_FEB = lonch13_APR = lonch13_JUL 203 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 204 268 205 269 ## FEBRUARY ## 270 ## ch12 ## 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)): 274 mean_outzch12_FEB[ilat, ilon] = mean(OUTZCH12_FEB[ilat, ilon, :]) 275 276 ## ch13 ## 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)): 280 mean_outzch13_FEB[ilat, ilon] = mean(OUTZCH13_FEB[ilat, ilon, :]) 281 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, :]) 287 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 295 ## APRIL ## 296 ## ch12 ## 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)): 300 mean_outzch12_APR[ilat, ilon] = mean(OUTZCH12_APR[ilat, ilon, :][nonzero(isnan(OUTZCH12_APR[ilat, ilon, :]) == False)]) 301 302 ## ch13 ## 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)): 306 mean_outzch13_APR[ilat, ilon] = mean(OUTZCH13_APR[ilat, ilon, :][nonzero(isnan(OUTZCH13_APR[ilat, ilon, :]) == False)]) 307 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)]) 313 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)]) 319 320 321 322 ## JULY ## 323 ## ch12 ## 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)): 327 mean_outzch12_JUL[ilat, ilon] = mean(OUTZCH12_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH12_JUL[ilat, ilon, :]) == False)]) 328 329 ## ch13 ## 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)): 333 mean_outzch13_JUL[ilat, ilon] = mean(OUTZCH13_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH13_JUL[ilat, ilon, :]) == False)]) 334 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)]) 340 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)]) 346 347 348 349 ###################### 350 ## calculs de stats ## 351 ###################### 352 353 ### VARIANCE - COVARIANCE ## 354 355 ## FEBRUARY ## 356 imo = 0 357 ## ch12 ## 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 365 ## ch13 ## 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) 370 371 var_FEB_13 = varF13 / len_month[imo] 372 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])) 378 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 424 ## ch12 ## 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 432 ## ch13 ## 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) 437 438 var_APR_13 = varA13 / len_month[imo] 439 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) 445 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() 206 502 figure() 207 plt.ion()208 ## ch12 ##209 subplot(2,1,1)210 503 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 211 504 m.drawcoastlines(linewidth = 1) … … 213 506 m.drawmeridians(np.arange(-180., 180., 20)) 214 507 xii,yii = m(*np.meshgrid(lon, lat)) 215 clevs = arange(0. 3, 1., 0.001)216 cs = m.contourf(xii, yii, mean_outzch12_FEB, clevs, cmap=cm.s3pcpn_l_r)508 clevs = arange(0., 0.0035, 0.00001) 509 cs = m.contourf(xii, yii, cov_JUL_1718, clevs, cmap=cm.s3pcpn_l_r) 217 510 cbar = colorbar(cs) 218 cbar.set_label('Mean emissivity FEB [CH12] - SSMIS') 219 ## ch13 ## 220 subplot(2,1,2) 221 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 222 m.drawcoastlines(linewidth = 1) 223 m.drawparallels(np.arange(-90., -30., 20)) 224 m.drawmeridians(np.arange(-180., 180., 20)) 225 clevs = arange(0.3, 1., 0.001) 226 cs = m.contourf(xii, yii, mean_outzch13_FEB, clevs, cmap=cm.s3pcpn_l_r) 227 cbar = colorbar(cs) 228 cbar.set_label('Mean emissivity FEB [CH13] - SSMIS') 229 ## BIAIS ch12-ch13 ## 230 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 231 m.drawcoastlines(linewidth = 1) 232 m.drawparallels(np.arange(-90., -30., 20)) 233 m.drawmeridians(np.arange(-180., 180., 20)) 234 biais_FEB = mean_outzch12_FEB - mean_outzch13_FEB 235 clevs = arange(-0.35, 0., 0.001) 236 cs = m.contourf(xii, yii, biais_FEB, clevs, cmap=cm.s3pcpn_l_r) 237 cbar = colorbar(cs) 238 cbar.set_label('Bias of Mean emissivity FEB [CH12-CH13] - SSMIS') 239 ## VARIANCE ch12 - ch13 ## 240 stddev = np.zeros([len(lat), len(lon)], float) 241 N = len(lon)*len(lat) 242 for ilat in range (0, len(lat)): 243 for ilon in range (0, len(lon)): 244 stddev[ilat, ilon] =(mean_outzch12_FEB[ilat, ilon]-mean_outzch13_FEB[ilat, ilon])**2 245 246 std_FEB = sqrt(stddev/N) 247 figure () 248 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 249 m.drawcoastlines(linewidth = 1) 250 m.drawparallels(np.arange(-90., -30., 20)) 251 m.drawmeridians(np.arange(-180., 180., 20)) 252 clevs = arange(0., 0.01, 0.0001) 253 cs = m.contourf(xii, yii, std_FEB, clevs, cmap=cm.s3pcpn_l_r) 254 cbar = colorbar(cs) 255 cbar.set_label('Stantard deviation of Mean emissivity FEB [CH12-CH13] - SSMIS') 256 511 cbar.set_label('covar(emis) JUL [CH17-CH18] - SSMIS') 512 xticks(arange(-180, 200, 20), rotation = 45) 513 yticks(arange(-90, -10, 20)) 514 515 516 ## BIAIS ## 517 518 ## FEBRUARY ## 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 523 524 ## APRIL ## 525 biais_APR_polar1 = mean_outzch12_APR - mean_outzch13_APR 526 biais_APR_polar2 = mean_outzch17_APR - mean_outzch18_APR 257 527 258 528 ## JULY ## 529 biais_JUL_polar1 = mean_outzch12_JUL - mean_outzch13_JUL 530 biais_JUL_polar2 = mean_outzch17_JUL - mean_outzch18_JUL 531 532 533 259 534 figure() 260 plt.ion()261 ## ch12 ##262 subplot(2,1,1)263 535 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 264 536 m.drawcoastlines(linewidth = 1) … … 266 538 m.drawmeridians(np.arange(-180., 180., 20)) 267 539 xii,yii = m(*np.meshgrid(lon, lat)) 268 clevs = arange( 0.3, 1., 0.001)269 cs = m.contourf(xii, yii, mean_outzch12_JUL, clevs, cmap=cm.s3pcpn_l_r)540 clevs = arange(-0.24, 0.32, 0.001) 541 cs = m.contourf(xii, yii, biais_FEB_freq2, clevs, cmap=cm.s3pcpn_l_r) 270 542 cbar = colorbar(cs) 271 cbar.set_label('Mean emissivity JUL [CH12] - SSMIS') 272 ## ch13 ## 273 subplot(2,1,2) 274 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 275 m.drawcoastlines(linewidth = 1) 276 m.drawparallels(np.arange(-90., -30., 20)) 277 m.drawmeridians(np.arange(-180., 180., 20)) 278 clevs = arange(0.3, 1., 0.001) 279 cs = m.contourf(xii, yii, mean_outzch13_JUL, clevs, cmap=cm.s3pcpn_l_r) 280 cbar = colorbar(cs) 281 cbar.set_label('Mean emissivity JUL [CH13] - SSMIS') 282 ## BIAIS ch12-ch13 ## 283 figure() 284 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 285 m.drawcoastlines(linewidth = 1) 286 m.drawparallels(np.arange(-90., -30., 20)) 287 m.drawmeridians(np.arange(-180., 180., 20)) 288 biais_JUL = mean_outzch12_JUL - mean_outzch13_JUL 289 clevs = arange(-0.30, 0., 0.001) 290 cs = m.contourf(xii, yii, biais_JUL, clevs, cmap=cm.s3pcpn_l_r) 291 cbar = colorbar(cs) 292 cbar.set_label('Bias of Mean emissivity JUL [CH12-CH13] - SSMIS') 293 ## VARIANCE ch12 - ch13 ## 294 stddev = np.zeros([len(lat), len(lon)], float) 295 N = len(lon)*len(lat) 296 for ilat in range (0, len(lat)): 297 for ilon in range (0, len(lon)): 298 stddev[ilat, ilon] =(mean_outzch12_JUL[ilat, ilon]-mean_outzch13_JUL[ilat, ilon])**2 299 300 std_JUL = sqrt(stddev/N) 301 figure () 302 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 303 m.drawcoastlines(linewidth = 1) 304 m.drawparallels(np.arange(-90., -30., 20)) 305 m.drawmeridians(np.arange(-180., 180., 20)) 306 clevs = arange(0., 0.01, 0.0001) 307 cs = m.contourf(xii, yii, std_JUL, clevs, cmap=cm.s3pcpn_l_r) 308 cbar = colorbar(cs) 309 cbar.set_label('Stantard deviation of Mean emissivity JUL [CH12-CH13] - SSMIS') 310 311 312 ## APRIL ## 313 figure() 314 plt.ion() 315 ## ch12 ## 316 subplot(2,1,1) 317 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 318 m.drawcoastlines(linewidth = 1) 319 m.drawparallels(np.arange(-90., -30., 20)) 320 m.drawmeridians(np.arange(-180., 180., 20)) 321 xii,yii = m(*np.meshgrid(lon, lat)) 322 clevs = arange(0.5, 1., 0.001) 323 cs = m.contourf(xii, yii, mean_outzch12_APR, clevs, cmap=cm.s3pcpn_l_r) 324 cbar = colorbar(cs) 325 cbar.set_label('Mean emissivity APR [CH12] - SSMIS') 326 ## ch13 ## 327 subplot(2,1,2) 328 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 329 m.drawcoastlines(linewidth = 1) 330 m.drawparallels(np.arange(-90., -30., 20)) 331 m.drawmeridians(np.arange(-180., 180., 20)) 332 clevs = arange(0.5, 1., 0.001) 333 cs = m.contourf(xii, yii, mean_outzch13_APR, clevs, cmap=cm.s3pcpn_l_r) 334 cbar = colorbar(cs) 335 cbar.set_label('Mean emissivity APR [CH13] - SSMIS') 336 ## BIAIS ch12-ch13 ## 337 figure() 338 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 339 m.drawcoastlines(linewidth = 1) 340 m.drawparallels(np.arange(-90., -30., 20)) 341 m.drawmeridians(np.arange(-180., 180., 20)) 342 biais_APR = mean_outzch12_APR - mean_outzch13_APR 343 clevs = arange(-0.04, -0.017, 0.0001) 344 cs = m.contourf(xii, yii, biais_APR, clevs, cmap=cm.s3pcpn_l_r) 345 cbar = colorbar(cs) 346 cbar.set_label('Bias of Mean emissivity APR [CH12-CH13] - SSMIS') 347 ## VARIANCE ch12 - ch13 ## 348 stddev = np.zeros([len(lat), len(lon)], float) 349 N = len(lon)*len(lat) 350 for ilat in range (0, len(lat)): 351 for ilon in range (0, len(lon)): 352 stddev[ilat, ilon] =(mean_outzch12_APR[ilat, ilon] - mean_outzch13_APR[ilat, ilon])**2 353 354 std_APR = sqrt(stddev/N) 355 figure () 356 m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) 357 m.drawcoastlines(linewidth = 1) 358 m.drawparallels(np.arange(-90., -30., 20)) 359 m.drawmeridians(np.arange(-180., 180., 20)) 360 clevs = arange(0., 0.0015, 0.00001) 361 cs = m.contourf(xii, yii, std_APR, clevs, cmap=cm.s3pcpn_l_r) 362 cbar = colorbar(cs) 363 cbar.set_label('Stantard deviation of Mean emissivity APR [CH12-CH13] - SSMIS') 364 365 366 ########################## 367 # DIAGRAMME DE HOVMOLLER # 368 ########################## 369 # shape(tbch17_anom_JUN) = [ilat, ilon, ijr] 370 ## sur la bande de latitude (-80° / -85°) 371 ## FEBRUARY ## 372 imo = 0 373 bbtranche_FEB = nonzero((lat >= -85.) & (lat <= -80)) 374 mean_std_FEB = np.zeros([len(lon), len_month[imo]], float) 375 for ilon in range (0, len(lon)): 376 for ijr in range (0,len_month[imo]): 377 mean_std_FEB[ilon,ijr] = mean(std_FEB[bbtranche_FEB][:,ilon,ijr]) 378 379 y_time, x_space = np.meshgrid(arange(0, len_month[imo], 1), lon) 380 fig = plt.figure() 381 plt.pcolor(x_space, y_time, mean_std_FEB, cmap=cm.s3pcpn_l_r, vmin = -10., vmax = 15.) 382 plt.axis([-180., 180., 0, 28]) 383 cb = plt.colorbar() 384 cb.set_label('std of emissivity - FEB SSMIS CH17') 385 plt.xticks(arange(-180.,200.,40)) 386 plt.yticks(arange(0, 28, 1), arange (1, 29, 1)) 387 plt.xlabel('longitude') 388 plt.ylabel('FEBRUARY 2010') 389 390 ## MAY ## 391 bbtranche17_MAY = nonzero((latch17_MAY >= -85.) & (latch17_MAY <= -75)) 392 mean_tbch17_anom_MAY = np.zeros([len(lonch17_MAY), 31], float) 393 for ilon in range (0, len(lonch17_MAY)): 394 for ijr in range (0,31): 395 mean_tbch17_anom_MAY[ilon,ijr] = mean(tbch17_anom_MAY[bbtranche17_MAY][:,ilon,ijr]) 396 397 y_time, x_space = np.meshgrid(arange(0,31,1), lonch17_MAY) 398 fig = plt.figure() 399 plt.pcolor(x_space, y_time, mean_tbch17_anom_MAY, cmap=cm.s3pcpn_l_r, vmin = -12., vmax = 25.) 400 plt.axis([-180., 180., 0, 30]) 401 cb = plt.colorbar() 402 cb.set_label('Tb anomaly - SSMIS CH17') 403 plt.xticks(arange(-180.,200.,40)) 404 plt.yticks(arange(0, 30, 1), arange(1,31,1)) 405 plt.xlabel('longitude') 406 plt.ylabel('MAY 2010') 407 408 ## JUNE ## 409 bbtranche17_JUN = nonzero((latch17_JUN >= -85.) & (latch17_JUN <= -75)) 410 mean_tbch17_anom_JUN = np.zeros([len(lonch17_JUN), 30], float) 411 for ilon in range (0, len(lonch17_JUN)): 412 for ijr in range (0,30): 413 mean_tbch17_anom_JUN[ilon,ijr] = tbch17_anom_JUN[bbtranche17_JUN][:,ilon,ijr].mean() 414 415 416 y_time, x_space = np.meshgrid(arange(0,30,1), lonch17_APR) 417 fig = plt.figure() 418 plt.pcolor(x_space, y_time, mean_tbch17_anom_APR, cmap=cm.s3pcpn_l_r, vmin = -30., vmax = 25.) 419 plt.axis([-180., 180., 0, 29]) 420 cb = plt.colorbar() 421 cb.set_label('Tb anomaly - SSMIS CH17') 422 plt.xticks(arange(-180.,220.,40)) 423 plt.yticks(arange(0, 30, 1), arange(1,31,1)) 424 plt.xlabel('longitude') 425 plt.ylabel('JUNE 2010') 426 543 cbar.set_label('biais(emis) FEB [CH13-CH17] - SSMIS') 544 xticks(arange(-180, 200, 20), rotation = 45) 545 yticks(arange(-90, -10, 20)) -
trunk/src/scripts_Laura/read_SSMIS_test.py
r22 r23 11 11 12 12 13 14 ################ fichiers par canal - mois de juin ################################################### 15 16 13 17 f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH' 14 18 f3 = '_ANTARC_JUNE2010.DAT' … … 26 30 27 31 28 ################ fichiers par canal - mois de juin ################################################### 32 29 33 30 34 … … 186 190 187 191 188 ################ fichiers par mois - canal 17 ################################################### 192 193 ############### fichiers par mois pour deux canaux (polars H et V) ################################## 194 195 ######## 196 # ch17 # 197 ######## 189 198 190 199 f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH17_ANTARC_' … … 323 332 324 333 325 ############### fichiers par mois pour deux canaux (polars H et V) ################################## 334 ######## 335 # ch18 # 336 ######## 337 338 f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH18_ANTARC_' 339 f3 = '2010.DAT' 340 date=np.array(['FEBRUARY', 'APRIL', 'JULY']) 341 numlines = np.zeros([len(date)],int) 342 343 for imo in range (0, len(date)): 344 print date[imo] 345 f = f1 + str(date[imo]) + f3 346 fichier = open(f, 'r') 347 numlines[imo] = 0 348 for line in fichier: numlines[imo] += 1 349 350 fichier.close() 351 352 353 imo = 0 # FEBUARY 354 fichier = open(f1 + str(date[imo]) + f3, 'r') 355 ssmis = np.zeros([18, numlines[imo]], float) 356 for iligne in range (0,numlines[imo]): 357 line = fichier.readline() 358 liste = line.split() 359 for j in range(0,18): 360 ssmis[j,iligne] = float(liste[j]) 361 362 fichier.close 363 364 ssch18_FEB=ssmis 365 lon18_FEB=ssch18_FEB[0,:] 366 lat18_FEB=ssch18_FEB[1,:] 367 jjr18_FEB=ssch18_FEB[4,:] 368 ts18_FEB=ssch18_FEB[8,:] 369 emis18_FEB=ssch18_FEB[14,:] 370 tb18_FEB=ssch18_FEB[13,:] 371 tup18_FEB=ssch18_FEB[16,:] 372 tdn18_FEB=ssch18_FEB[15,:] 373 trans18_FEB=ssch18_FEB[17,:] 374 orog18_FEB=ssch18_FEB[11,:] 375 376 377 imo = 1 # APRIL 378 fichier = open(f1 + str(date[imo]) + f3, 'r') 379 ssmis = np.zeros([18, numlines[imo]], float) 380 for iligne in range (0,numlines[imo]): 381 line = fichier.readline() 382 liste = line.split() 383 for j in range(0,18): 384 ssmis[j,iligne] = float(liste[j]) 385 386 fichier.close 387 388 ssch18_APR=ssmis 389 lon18_APR=ssch18_APR[0,:] 390 lat18_APR=ssch18_APR[1,:] 391 jjr18_APR=ssch18_APR[4,:] 392 ts18_APR=ssch18_APR[8,:] 393 emis18_APR=ssch18_APR[14,:] 394 tb18_APR=ssch18_APR[13,:] 395 tup18_APR=ssch18_APR[16,:] 396 tdn18_APR=ssch18_APR[15,:] 397 trans18_APR=ssch18_APR[17,:] 398 orog18_APR=ssch18_APR[11,:] 399 400 401 402 imo = 2 # JULY 403 fichier = open(f1 + str(date[imo]) + f3, 'r') 404 ssmis = np.zeros([18, numlines[imo]], float) 405 for iligne in range (0,numlines[imo]): 406 line = fichier.readline() 407 liste = line.split() 408 for j in range(0,18): 409 ssmis[j,iligne] = float(liste[j]) 410 411 fichier.close 412 413 ssch18_JUL=ssmis 414 lon18_JUL=ssch18_JUL[0,:] 415 lat18_JUL=ssch18_JUL[1,:] 416 jjr18_JUL=ssch18_JUL[4,:] 417 ts18_JUL=ssch18_JUL[8,:] 418 emis18_JUL=ssch18_JUL[14,:] 419 tb18_JUL=ssch18_JUL[13,:] 420 tup18_JUL=ssch18_JUL[16,:] 421 tdn18_JUL=ssch18_JUL[15,:] 422 trans18_JUL=ssch18_JUL[17,:] 423 orog18_JUL=ssch18_JUL[11,:] 424 326 425 327 426 ##########
Note: See TracChangeset
for help on using the changeset viewer.