#!/usr/bin/env python # -*- coding: utf-8 -*- import string import numpy as np import matplotlib.pyplot as plt from pylab import * from mpl_toolkits.basemap import Basemap from mpl_toolkits.basemap import shiftgrid, cm from netCDF4 import Dataset import ffgrid2 len_month = np.array([28, 30, 31]) month = np.array(['FEBRUARY', 'APRIL', 'JULY']) ################ # CARTOGRAPHIE # ################ ## Etude sur l'Antarctique ## dx = 5. dy = 5. x0, x1 = -180, 180 y0, y1 = -90, -30 ## FEBRUARY ## imo = 0 ## ch12 ## bbemis_ch12_FEB = nonzero((emis12_FEB != -500.) & (emis12_FEB <= 1.)) OUTZCH12_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch12_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch12_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch12_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch13 ## bbemis_ch13_FEB = nonzero((emis13_FEB != -500.) & (emis13_FEB <= 1.)) OUTZCH13_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch13_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch13_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch13_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch17 ## bbemis_ch17_FEB = nonzero((emis17_FEB != -500.) & (emis17_FEB <= 1.)) OUTZCH17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch17_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch17_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch18 ## bbemis_ch18_FEB = nonzero((emis18_FEB != -500.) & (emis18_FEB <= 1.)) OUTZCH18_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch18_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch18_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch18_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float) for ijr in range (0, len_month[imo]): print 'jour=', ijr+1 ## ch17 ## ind_jr17_FEB = np.where(jjr17_FEB[bbemis_ch17_FEB] == ijr+1)[0] xx = lon17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] yy = lat17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] zz = emis17_FEB[bbemis_ch17_FEB][ind_jr17_FEB] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch17_FEB = outz lonch17_FEB = outx latch17_FEB = outy OUTZCH17_FEB[:,:,ijr] = outzch17_FEB[:,:] ## ch18 ## ind_jr18_FEB = np.where(jjr18_FEB[bbemis_ch18_FEB] == ijr+1)[0] xx = lon18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] yy = lat18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] zz = emis18_FEB[bbemis_ch18_FEB][ind_jr18_FEB] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch18_FEB = outz lonch18_FEB = outx latch18_FEB = outy OUTZCH18_FEB[:,:,ijr] = outzch18_FEB[:,:] ## ch12 ## ind_jr12_FEB = np.where(jjr12_FEB[bbemis_ch12_FEB] == ijr+1)[0] xx = lon12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] yy = lat12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] zz = emis12_FEB[bbemis_ch12_FEB][ind_jr12_FEB] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch12_FEB = outz lonch12_FEB = outx latch12_FEB = outy OUTZCH12_FEB[:,:,ijr] = outzch12_FEB[:,:] ## ch13 ## ind_jr13_FEB = np.where(jjr13_FEB[bbemis_ch13_FEB] == ijr+1)[0] xx = lon13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] yy = lat13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] zz = emis13_FEB[bbemis_ch13_FEB][ind_jr13_FEB] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch13_FEB = outz lonch13_FEB = outx latch13_FEB = outy OUTZCH13_FEB[:,:,ijr] = outzch13_FEB[:,:] ## APRIL ## imo = 1 ## ch12 ## bbemis_ch12_APR = nonzero((emis12_APR != -500.) & (emis12_APR <= 1.)) OUTZCH12_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch12_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch12_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch12_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch13 ## bbemis_ch13_APR = nonzero((emis13_APR != -500.) & (emis13_APR <= 1.)) OUTZCH13_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch13_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch13_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch13_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch17 ## bbemis_ch17_APR = nonzero((emis17_APR != -500.) & (emis17_APR <= 1.)) OUTZCH17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch17_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch17_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch18 ## bbemis_ch18_APR = nonzero((emis18_APR != -500.) & (emis18_APR <= 1.)) OUTZCH18_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch18_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch18_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch18_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float) for ijr in range (0, len_month[imo]): print 'jour=', ijr+1 ## ch17 ## ind_jr17_APR = np.where(jjr17_APR[bbemis_ch17_APR] == ijr+1)[0] xx = lon17_APR[bbemis_ch17_APR][ind_jr17_APR] yy = lat17_APR[bbemis_ch17_APR][ind_jr17_APR] zz = emis17_APR[bbemis_ch17_APR][ind_jr17_APR] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch17_APR = outz lonch17_APR = outx latch17_APR = outy OUTZCH17_APR[:,:,ijr] = outzch17_APR[:,:] ## ch18 ## ind_jr18_APR = np.where(jjr18_APR[bbemis_ch18_APR] == ijr+1)[0] xx = lon18_APR[bbemis_ch18_APR][ind_jr18_APR] yy = lat18_APR[bbemis_ch18_APR][ind_jr18_APR] zz = emis18_APR[bbemis_ch18_APR][ind_jr18_APR] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch18_APR = outz lonch18_APR = outx latch18_APR = outy OUTZCH18_APR[:,:,ijr] = outzch18_APR[:,:] ## ch12 ## ind_jr12_APR = np.where(jjr12_APR[bbemis_ch12_APR] == ijr+1)[0] xx = lon12_APR[bbemis_ch12_APR][ind_jr12_APR] yy = lat12_APR[bbemis_ch12_APR][ind_jr12_APR] zz = emis12_APR[bbemis_ch12_APR][ind_jr12_APR] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch12_APR = outz lonch12_APR = outx latch12_APR = outy OUTZCH12_APR[:,:,ijr] = outzch12_APR[:,:] ## ch13 ## ind_jr13_APR = np.where(jjr13_APR[bbemis_ch13_APR] == ijr+1)[0] xx = lon13_APR[bbemis_ch13_APR][ind_jr13_APR] yy = lat13_APR[bbemis_ch13_APR][ind_jr13_APR] zz = emis13_APR[bbemis_ch13_APR][ind_jr13_APR] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch13_APR = outz lonch13_APR = outx latch13_APR = outy OUTZCH13_APR[:,:,ijr] = outzch13_APR[:,:] ## JULY ## imo = 2 ## ch12 ## bbemis_ch12_JUL = nonzero((emis12_JUL != -500.) & (emis12_JUL <= 1.)) OUTZCH12_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch12_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch12_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch12_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch13 ## bbemis_ch13_JUL = nonzero((emis13_JUL != -500.) & (emis13_JUL <= 1.)) OUTZCH13_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch13_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch13_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch13_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch17 ## bbemis_ch17_JUL = nonzero((emis17_JUL != -500.) & (emis17_JUL <= 1.)) OUTZCH17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch17_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch17_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) ## ch18 ## bbemis_ch18_JUL = nonzero((emis18_JUL != -500.) & (emis18_JUL <= 1.)) OUTZCH18_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) outzch18_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) lonch18_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float) latch18_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float) for ijr in range (0, len_month[imo]): print 'jour=', ijr+1 ## ch17 ## ind_jr17_JUL = np.where(jjr17_JUL[bbemis_ch17_JUL] == ijr+1)[0] xx = lon17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] yy = lat17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] zz = emis17_JUL[bbemis_ch17_JUL][ind_jr17_JUL] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch17_JUL = outz lonch17_JUL = outx latch17_JUL = outy OUTZCH17_JUL[:,:,ijr] = outzch17_JUL[:,:] ## ch18 ## ind_jr18_JUL = np.where(jjr18_JUL[bbemis_ch18_JUL] == ijr+1)[0] xx = lon18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] yy = lat18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] zz = emis18_JUL[bbemis_ch18_JUL][ind_jr18_JUL] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch18_JUL = outz lonch18_JUL = outx latch18_JUL = outy OUTZCH18_JUL[:,:,ijr] = outzch18_JUL[:,:] ## ch12 ## ind_jr12_JUL = np.where(jjr12_JUL[bbemis_ch12_JUL] == ijr+1)[0] xx = lon12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] yy = lat12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] zz = emis12_JUL[bbemis_ch12_JUL][ind_jr12_JUL] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch12_JUL = outz lonch12_JUL = outx latch12_JUL = outy OUTZCH12_JUL[:,:,ijr] = outzch12_JUL[:,:] ## ch13 ## ind_jr13_JUL = np.where(jjr13_JUL[bbemis_ch13_JUL] == ijr+1)[0] xx = lon13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] yy = lat13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] zz = emis13_JUL[bbemis_ch13_JUL][ind_jr13_JUL] zz0 = min(zz) zz1 = max(zz) outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) outzch13_JUL = outz lonch13_JUL = outx latch13_JUL = outy OUTZCH13_JUL[:,:,ijr] = outzch13_JUL[:,:] ################################################ ## calcul de la climatologie moyenne par mois ## ################################################ lon = lonch12_FEB = lonch12_APR = lonch12_JUL = lonch13_FEB = lonch13_APR = lonch13_JUL lat = latch12_FEB = latch12_APR = latch12_JUL = latch13_FEB = latch13_APR = latch13_JUL #lon = lonch17_FEB = lonch17_APR = lonch17_JUL = lonch18_FEB = lonch18_APR = lonch18_JUL #lat = latch17_FEB = latch17_APR = latch17_JUL = latch18_FEB = latch18_APR = latch18_JUL ## FEBRUARY ## ## ch12 ## mean_outzch12_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch12_FEB[ilat, ilon] = mean(OUTZCH12_FEB[ilat, ilon, :]) ## ch13 ## mean_outzch13_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch13_FEB[ilat, ilon] = mean(OUTZCH13_FEB[ilat, ilon, :]) ## ch17 ## mean_outzch17_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch17_FEB[ilat, ilon] = mean(OUTZCH17_FEB[ilat, ilon, :]) ## ch18 ## mean_outzch18_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch18_FEB[ilat, ilon] = mean(OUTZCH18_FEB[ilat, ilon, :]) ## APRIL ## ## ch12 ## mean_outzch12_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch12_APR[ilat, ilon] = mean(OUTZCH12_APR[ilat, ilon, :][nonzero(isnan(OUTZCH12_APR[ilat, ilon, :]) == False)]) ## ch13 ## mean_outzch13_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch13_APR[ilat, ilon] = mean(OUTZCH13_APR[ilat, ilon, :][nonzero(isnan(OUTZCH13_APR[ilat, ilon, :]) == False)]) ## ch17 ## mean_outzch17_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch17_APR[ilat, ilon] = mean(OUTZCH17_APR[ilat, ilon, :][nonzero(isnan(OUTZCH17_APR[ilat, ilon, :]) == False)]) ## ch18 ## mean_outzch18_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch18_APR[ilat, ilon] = mean(OUTZCH18_APR[ilat, ilon, :][nonzero(isnan(OUTZCH18_APR[ilat, ilon, :]) == False)]) ## JULY ## ## ch12 ## mean_outzch12_JUL = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch12_JUL[ilat, ilon] = mean(OUTZCH12_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH12_JUL[ilat, ilon, :]) == False)]) ## ch13 ## mean_outzch13_JUL = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch13_JUL[ilat, ilon] = mean(OUTZCH13_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH13_JUL[ilat, ilon, :]) == False)]) ## ch17 ## mean_outzch17_JUL = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch17_JUL[ilat, ilon] = mean(OUTZCH17_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH17_JUL[ilat, ilon, :]) == False)]) ## ch18 ## mean_outzch18_JUL = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): mean_outzch18_JUL[ilat, ilon] = mean(OUTZCH18_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH18_JUL[ilat, ilon, :]) == False)]) ###################### ## calculs de stats ## ###################### ### VARIANCE - COVARIANCE ## ## FEBRUARY ## imo = 0 ## ch12 ## varF12 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varF12[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])**2) var_FEB_12 = varF12 / len_month[imo] ## ch13 ## varF13 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varF13[ilat, ilon] = np.sum((OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])**2) var_FEB_13 = varF13 / len_month[imo] ## ch12-ch13 ## cov_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_FEB[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])*(OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])) cov_FEB_1213 = cov_FEB / len_month[imo] ## ch17 ## varF17 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varF17[ilat, ilon] = np.sum((OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])**2) var_FEB_17 = varF17 / len_month[imo] ## ch18 ## varF18 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varF18[ilat, ilon] = np.sum((OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])**2) var_FEB_18 = varF18 / len_month[imo] ## ch17-ch18 ## cov_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_FEB[ilat, ilon] = np.sum((OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])*(OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])) cov_FEB_1718 = cov_FEB / len_month[imo] ## ch13-ch17 ## cov_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_FEB[ilat, ilon] = np.sum((OUTZCH13_FEB[ilat, ilon, :] - mean_outzch13_FEB[ilat, ilon])*(OUTZCH17_FEB[ilat, ilon, :] - mean_outzch17_FEB[ilat, ilon])) cov_FEB_1317 = cov_FEB / len_month[imo] ## ch12-ch18 ## cov_FEB = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_FEB[ilat, ilon] = np.sum((OUTZCH12_FEB[ilat, ilon, :] - mean_outzch12_FEB[ilat, ilon])*(OUTZCH18_FEB[ilat, ilon, :] - mean_outzch18_FEB[ilat, ilon])) cov_FEB_1218 = cov_FEB / len_month[imo] ## APRIL ## imo = 1 ## ch12 ## varA12 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varA12[ilat, ilon] = np.sum((OUTZCH12_APR[ilat, ilon, :] - mean_outzch12_APR[ilat, ilon])**2) var_APR_12 = varA12 / len_month[imo] ## ch13 ## varA13 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varA13[ilat, ilon] = np.sum((OUTZCH13_APR[ilat, ilon, :] - mean_outzch13_APR[ilat, ilon])**2) var_APR_13 = varA13 / len_month[imo] ## ch17 ## varA17 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varA17[ilat, ilon] = np.sum((OUTZCH17_APR[ilat, ilon, :] - mean_outzch17_APR[ilat, ilon])**2) var_APR_17 = varA17 / len_month[imo] ## ch18 ## varA18 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varA18[ilat, ilon] = np.sum((OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])**2) var_APR_18 = varA18 / len_month[imo] ## ch17-ch18 ## cov_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_APR[ilat, ilon] = np.sum((OUTZCH17_APR[ilat, ilon, :] - mean_outzch17_APR[ilat, ilon])*(OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])) cov_APR_1718 = cov_APR / len_month[imo] ## ch12-ch18 ## cov_APR = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): cov_APR[ilat, ilon] = np.sum((OUTZCH12_APR[ilat, ilon, :] - mean_outzch12_APR[ilat, ilon])*(OUTZCH18_APR[ilat, ilon, :] - mean_outzch18_APR[ilat, ilon])) cov_APR_1218 = cov_APR / len_month[imo] ## JULY ## imo = 2 ## ch17 ## varJ17 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varJ17[ilat, ilon] = np.sum((OUTZCH17_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH17_JUL[ilat, ilon, :]) == False)] - mean_outzch17_JUL[ilat, ilon])**2) var_JUL_17 = varJ17 / len_month[imo] ## ch18 ## varJ18 = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): varJ18[ilat, ilon] = np.sum((OUTZCH18_JUL[ilat, ilon, :][nonzero(isnan(OUTZCH18_JUL[ilat, ilon, :]) == False)] - mean_outzch18_JUL[ilat, ilon])**2) var_JUL_18 = varJ18 / len_month[imo] ## ch17-ch18 ## cov_JUL = np.zeros([len(lat), len(lon)], float) for ilon in range (0, len(lon)): for ilat in range (0, len(lat)): 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])) cov_JUL_1718 = cov_JUL / len_month[imo] plt.ion() figure() m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) m.drawcoastlines(linewidth = 1) m.drawparallels(np.arange(-90., -30., 20)) m.drawmeridians(np.arange(-180., 180., 20)) xii,yii = m(*np.meshgrid(lon, lat)) clevs = arange(0., 0.0035, 0.00001) cs = m.contourf(xii, yii, cov_JUL_1718, clevs, cmap=cm.s3pcpn_l_r) cbar = colorbar(cs) cbar.set_label('covar(emis) JUL [CH17-CH18] - SSMIS') xticks(arange(-180, 200, 20), rotation = 45) yticks(arange(-90, -10, 20)) ## BIAIS ## ## FEBRUARY ## biais_FEB_polar1 = mean_outzch12_FEB - mean_outzch13_FEB biais_FEB_polar2 = mean_outzch17_FEB - mean_outzch18_FEB biais_FEB_freq1 = mean_outzch12_FEB - mean_outzch18_FEB biais_FEB_freq2 = mean_outzch13_FEB - mean_outzch17_FEB ## APRIL ## biais_APR_polar1 = mean_outzch12_APR - mean_outzch13_APR biais_APR_polar2 = mean_outzch17_APR - mean_outzch18_APR ## JULY ## biais_JUL_polar1 = mean_outzch12_JUL - mean_outzch13_JUL biais_JUL_polar2 = mean_outzch17_JUL - mean_outzch18_JUL figure() m = Basemap(llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=-30, projection='cyl', resolution='c', fix_aspect=True) m.drawcoastlines(linewidth = 1) m.drawparallels(np.arange(-90., -30., 20)) m.drawmeridians(np.arange(-180., 180., 20)) xii,yii = m(*np.meshgrid(lon, lat)) clevs = arange(-0.24, 0.32, 0.001) cs = m.contourf(xii, yii, biais_FEB_freq2, clevs, cmap=cm.s3pcpn_l_r) cbar = colorbar(cs) cbar.set_label('biais(emis) FEB [CH13-CH17] - SSMIS') xticks(arange(-180, 200, 20), rotation = 45) yticks(arange(-90, -10, 20))