Index: /trunk/src/scripts_Laura/calculs_SSMIS_test.py
===================================================================
--- /trunk/src/scripts_Laura/calculs_SSMIS_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/calculs_SSMIS_test.py	(revision 30)
@@ -0,0 +1,649 @@
+#!/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
+
+
+
+
+########################
+# EVOLUTION TEMPORELLE #
+########################
+
+## ZONE1 = Autour de "Dome C" (lon=123.23;lat=-75.06) - mois: JUNE ##
+## ch17 ##
+#bbzone_CH17_JUN = nonzero((lon17_JUN >= 120.23) & (lon17_JUN <= 126.23) & (lat17_JUN >= -78.06) & (lat17_JUN <= -72.06))
+
+## ch18 ##
+#bbzone_CH18_JUN = nonzero((lon18_JUN >= 120.23) & (lon18_JUN <= 126.23) & (lat18_JUN >= -78.06) & (lat18_JUN <= -72.06))
+
+
+## ZONE2 = Autre zone de glace de mer / de continent (lon entre -40 et -60 // lat entre -75 et -85) ##
+## ch17 ##
+bbzone_CH17_FEB = nonzero((lon17_FEB >= -60.) & (lon17_FEB <= -40.) & (lat17_FEB >= -85.) & (lat17_FEB <= -75.))
+bbzone_CH17_APR = nonzero((lon17_APR >= -60.) & (lon17_APR <= -40.) & (lat17_APR >= -85.) & (lat17_APR <= -75.))
+bbzone_CH17_MAY = nonzero((lon17_MAY >= -60.) & (lon17_MAY <= -40.) & (lat17_MAY >= -85.) & (lat17_MAY <= -75.))
+bbzone_CH17_JUN = nonzero((lon17_JUN >= -60.) & (lon17_JUN <= -40.) & (lat17_JUN >= -85.) & (lat17_JUN <= -75.))
+bbzone_CH17_JUL = nonzero((lon17_JUL >= -60.) & (lon17_JUL <= -40.) & (lat17_JUL >= -85.) & (lat17_JUL <= -75.))
+
+## ch18 ##
+#bbzone_CH18_JUN = nonzero((lon18_JUN >= -60.) & (lon18_JUN <= -40.) & (lat18_JUN >= -85.) & (lat18_JUN <= -75.))
+
+## ch 16 ##
+#bbzone_CH16_JUN = nonzero((lon16_JUN >= 120.23) & (lon16_JUN <= 126.23) & (lat16_JUN >= -78.06) & (lat16_JUN <= -72.06))
+
+
+## FEBUARY ##
+emis17_FEB_moy = np.zeros([28],float)
+tb17_FEB_moy = np.zeros([28],float)
+ts17_FEB_moy = np.zeros([28],float)
+orog17_FEB_moy = np.zeros([28],float)
+for ijr in range (0,28):
+     print 'jour=', ijr+1
+     ## ch17 ##
+     ind_jr17_FEB = np.where(jjr17_FEB[bbzone_CH17_FEB]==ijr+1)[0]
+     a = emis17_FEB[bbzone_CH17_FEB][ind_jr17_FEB]
+     b = tb17_FEB[bbzone_CH17_FEB][ind_jr17_FEB]
+     c = ts17_FEB[bbzone_CH17_FEB][ind_jr17_FEB]
+     d = orog17_FEB[bbzone_CH17_FEB][ind_jr17_FEB]
+     emis17_FEB_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
+     tb17_FEB_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
+     ts17_FEB_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
+     orog17_FEB_moy[ijr] = mean(d[nonzero((d!=-500.))])
+
+
+## APRIL ##
+emis17_APR_moy = np.zeros([30],float)
+tb17_APR_moy = np.zeros([30],float)
+ts17_APR_moy = np.zeros([30],float)
+orog17_APR_moy = np.zeros([30],float)
+for ijr in range (0,30):
+     print 'jour=', ijr+1
+     ind_jr17_APR = np.where(jjr17_APR[bbzone_CH17_APR]==ijr+1)[0]
+     a = emis17_APR[bbzone_CH17_APR][ind_jr17_APR]
+     b = tb17_APR[bbzone_CH17_APR][ind_jr17_APR]
+     c = ts17_APR[bbzone_CH17_APR][ind_jr17_APR]
+     d = orog17_APR[bbzone_CH17_APR][ind_jr17_APR]
+     emis17_APR_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
+     tb17_APR_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
+     ts17_APR_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
+     orog17_APR_moy[ijr] = mean(d[nonzero((d!=-500.))])
+
+
+## MAY ##
+emis17_MAY_moy = np.zeros([31],float)
+tb17_MAY_moy = np.zeros([31],float)
+ts17_MAY_moy = np.zeros([31],float)
+orog17_MAY_moy = np.zeros([31],float)
+for ijr in range (0,31):
+     print 'jour=', ijr+1
+     ind_jr17_MAY = np.where(jjr17_MAY[bbzone_CH17_MAY]==ijr+1)[0]
+     a = emis17_MAY[bbzone_CH17_MAY][ind_jr17_MAY]
+     b = tb17_MAY[bbzone_CH17_MAY][ind_jr17_MAY]
+     c = ts17_MAY[bbzone_CH17_MAY][ind_jr17_MAY]
+     d = orog17_MAY[bbzone_CH17_MAY][ind_jr17_MAY]
+     emis17_MAY_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
+     tb17_MAY_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
+     ts17_MAY_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
+     orog17_MAY_moy[ijr] = mean(d[nonzero((d!=-500.))])
+
+
+## JUNE ##
+emis17_JUN_moy = np.zeros([30],float)
+tb17_JUN_moy = np.zeros([30],float)
+ts17_JUN_moy = np.zeros([30],float)
+#orog17_JUN_moy = np.zeros([30],float)
+#emis18_JUN_moy = np.zeros([30],float)
+#tb18_JUN_moy = np.zeros([30],float)
+#ts18_JUN_moy = np.zeros([30],float)
+#emis16_JUN_moy = np.zeros([30],float)
+#tb16_JUN_moy = np.zeros([30],float)
+#ts16_JUN_moy = np.zeros([30],float)
+for ijr in range (0,30):
+     print 'jour=', ijr+1
+     ind_jr17_JUN = np.where(jjr17_JUN[bbzone_CH17_JUN]==ijr+1)[0]
+     a = emis17_JUN[bbzone_CH17_JUN][ind_jr17_JUN]
+     b = tb17_JUN[bbzone_CH17_JUN][ind_jr17_JUN]
+     c = ts17_JUN[bbzone_CH17_JUN][ind_jr17_JUN]
+     d = orog17_JUN[bbzone_CH17_JUN][ind_jr17_JUN]
+     emis17_JUN_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
+     tb17_JUN_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
+     ts17_JUN_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
+#     orog17_JUN_moy[ijr] = mean(d[nonzero((d!=-500.))])
+     ## ch18 ##
+#     ind_jr18 = np.where(jjr18_JUN[bbzone_CH18_JUN]==ijr+1)[0]
+#     d = emis18_JUN[bbzone_CH18_JUN][ind_jr18]
+#     e = tb18_JUN[bbzone_CH18_JUN][ind_jr18]
+#     f = ts18_JUN[bbzone_CH18_JUN][ind_jr18]
+#     emis18_JUN_moy[ijr] = mean(d[nonzero((d != -500.) & (d <= 1.))])
+#     tb18_JUN_moy[ijr] = mean(e[nonzero((e != -500.) & (e != 0.))])
+#     ts18_JUN_moy[ijr] = mean(f[nonzero((f != -500.) & (f != 0.))])
+     ## ch16 ##
+#     ind_jr16 = np.where(jjr16_JUN[bbzone_CH16_JUN]==ijr+1)[0]
+#     g = emis16_JUN[bbzone_CH16_JUN][ind_jr16]
+#     h = tb16_JUN[bbzone_CH16_JUN][ind_jr16]
+#     l = ts16_JUN[bbzone_CH16_JUN][ind_jr16]
+#     emis16_JUN_moy[ijr] = mean(g[nonzero((g != -500.) & (g <= 1.))])
+#     tb16_JUN_moy[ijr] = mean(h[nonzero((h != -500.) & (h != 0.))])
+#     ts16_JUN_moy[ijr] = mean(l[nonzero((l != -500.) & (l != 0.))])
+
+
+## JULY ##
+emis17_JUL_moy = np.zeros([31],float)
+tb17_JUL_moy = np.zeros([31],float)
+ts17_JUL_moy = np.zeros([31],float)
+orog17_JUL_moy = np.zeros([31],float)
+for ijr in range (0,31):
+     print 'jour=', ijr+1
+     ind_jr17_JUL = np.where(jjr17_JUL[bbzone_CH17_JUL]==ijr+1)[0]
+     a = emis17_JUL[bbzone_CH17_JUL][ind_jr17_JUL]
+     b = tb17_JUL[bbzone_CH17_JUL][ind_jr17_JUL]
+     c = ts17_JUL[bbzone_CH17_JUL][ind_jr17_JUL]
+     d = orog17_JUL[bbzone_CH17_JUL][ind_jr17_JUL]
+     emis17_JUL_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
+     tb17_JUL_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
+     ts17_JUL_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
+     orog17_JUL_moy[ijr] = mean(d[nonzero((d!=-500.))])
+
+
+## plot evolution temporelle ##
+## FEBUARY ##
+fig = plt.figure()
+plt.subplot(3, 1, 1)
+plt.title('FEBUARY')
+plt.plot(arange(0, 28, 1), emis17_FEB_moy, c = 'b')
+plt.ylabel('Emissivity')
+xticks(arange(0, 28, 1), arange(1, 29, 1))
+xlim (0, 28)
+grid(True)
+plt.subplot(3, 1, 2)
+plt.plot(arange(0, 28, 1), tb17_FEB_moy, c = 'g', label = 'Tb')
+ylabel('Brightness temperature')
+xticks(arange(0, 28, 1), arange(1, 29, 1))
+xlim (0, 28)
+grid(True)
+plt.subplot(3, 1, 3)
+plt.plot(arange(0, 28, 1), ts17_FEB_moy, c = 'r', label = 'Ts')
+plt.ylabel('Surface temperature')
+xticks(arange(0, 28, 1), arange(1, 29, 1))
+xlim (0, 28)
+grid(True)
+fig.show()
+
+## from APRIL to JULY ##
+emis1 = np.append(emis17_APR_moy, emis17_MAY_moy)
+emis2 = np.append(emis1, emis17_JUN_moy)
+emis17_moy = np.append(emis2, emis17_JUL_moy)
+tb1 = np.append(tb17_APR_moy, tb17_MAY_moy)
+tb2 = np.append(tb1, tb17_JUN_moy)
+tb17_moy = np.append(tb2, tb17_JUL_moy)
+ts1 = np.append(ts17_APR_moy, ts17_MAY_moy)
+ts2 = np.append(ts1, ts17_JUN_moy)
+ts17_moy = np.append(ts2, ts17_JUL_moy)
+fig = plt.figure()
+plt.subplot(3, 1, 1)
+plt.plot(arange(0, 122, 1), emis17_moy, c = 'b')
+plt.ylabel('Emissivity')
+xticks(array([0, 30, 61, 91, 122]), date[1:])
+xlim (0, 122)
+grid(True)
+plt.subplot(3, 1, 2)
+plt.plot(arange(0, 122, 1), tb17_moy, c = 'g', label = 'Tb')
+ylabel('Brightness temperature')
+xticks(array([0, 30, 61, 91, 122]), date[1:])
+xlim (0, 122)
+grid(True)
+plt.subplot(3, 1, 3)
+plt.plot(arange(0, 122, 1), ts17_moy, c = 'r', label = 'Ts')
+plt.ylabel('Surface temperature')
+xticks(array([0, 30, 61, 91, 122]), date[1:])
+xlim (0, 122)
+grid(True)
+fig.show()
+
+## JUNE ##
+## ch17 - ch18 ##
+fig=plt.figure()
+plt.subplot(3,1,1)
+plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='r')
+plt.plot(arange(0,30,1),emis18_JUN_moy,label='91.66GHz-H',c='b')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('emissivity')
+legend(loc=7)
+plt.title('SSMIS - JUNE 2010')
+plt.subplot(3,1,2)
+plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='r')
+plt.plot(arange(0,30,1),tb18_JUN_moy,label='91.66GHz-H',c='b')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('brightness temperature')
+legend(loc=7)
+plt.subplot(3,1,3)
+plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='r')
+plt.plot(arange(0,30,1),ts18_JUN_moy,label='91.66GHz-H',c='b')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('surface temperature')
+legend(loc=7)
+fig.show()
+## ch16 - ch17 ##
+fig=plt.figure()
+plt.subplot(3,1,1)
+plt.plot(arange(0,30,1),emis16_JUN_moy,label='37GHz-V',c='r')
+plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='g')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('emissivity')
+legend(loc=7)
+plt.title('SSMIS - JUNE 2010')
+plt.subplot(3,1,2)
+plt.plot(arange(0,30,1),tb16_JUN_moy,label='37GHz-V',c='r')
+plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='g')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('brightness temperature')
+legend(loc=7)
+plt.subplot(3,1,3)
+plt.plot(arange(0,30,1),ts16_JUN_moy,label='37GHz-V',c='r')
+plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='g')
+plt.xticks(arange(1,31,1))
+grid(True)
+ylabel('surface temperature')
+legend(loc=7)
+fig.show()
+
+
+## calcul anomalie de Tb
+## FEBUARY ##
+tb17_FEB_anom = np.zeros([28], float)
+for ijr in range (0,28):
+     print 'jour=', ijr + 1
+     tb17_FEB_anom[ijr]=tb17_FEB_moy[ijr]-mean(tb17_FEB_moy)
+
+## APRIL ##
+tb17_APR_anom = np.zeros([30], float)
+for ijr in range (0,30):
+     print 'jour=', ijr + 1
+     tb17_APR_anom[ijr]=tb17_APR_moy[ijr]-mean(tb17_APR_moy)
+
+## MAY ##
+bbnan = nonzero(isnan(tb17_MAY_moy) == False)
+tb17_MAY_anom = np.zeros([31], float)
+for ijr in range (0,31):
+     print 'jour=', ijr + 1
+     tb17_MAY_anom[ijr]=tb17_MAY_moy[ijr]-mean(tb17_MAY_moy[bbnan])
+
+## JUNE ##
+tb17_JUN_anom = np.zeros([30],float)
+#tb18_JUN_anom = np.zeros([30],float)
+for ijr in range (0,30):
+     print 'jour=', ijr + 1
+     tb17_JUN_anom[ijr]=tb17_JUN_moy[ijr]-mean(tb17_JUN_moy)
+#     tb18_JUN_anom[ijr]=tb18_JUN_moy[ijr]-mean(tb18_JUN_moy)
+
+## JULY ##
+tb17_JUL_anom = np.zeros([31],float)
+for ijr in range (0,30):
+     print 'jour=', ijr + 1
+     tb17_JUL_anom[ijr]=tb17_JUL_moy[ijr]-mean(tb17_JUL_moy)
+
+
+
+a1 = np.append(tb17_APR_anom, tb17_MAY_anom)
+a2 = np.append(a1, tb17_JUN_anom)
+tb17_month_anom = np.append(a2, tb17_JUL_anom)
+
+
+## for APRIL to JULY ##
+fig = plt.figure()
+plt.plot(arange(0, 122, 1), tb17_month_anom, c = 'k')
+plt.plot(arange(0, 122, 1), np.zeros([122]), '--', c = 'r')
+ylabel('Tb anomaly (K)')
+xlim(0, 122)
+xticks(array([0, 30, 61, 91 122]), date[1:])
+grid(True)
+plt.title('SSMIS - zone2')
+fig.show()
+
+## FEBRUARY ##
+fig = plt.figure()
+plt.plot(arange(0, 28, 1), tb17_FEB_anom, c = 'k')
+plt.plot(arange(0, 28, 1), np.zeros([28]), '--', c = 'r')
+ylabel('Tb anomaly (K)')
+xlim(0, 27)
+xticks(arange(0, 28, 1), arange(1, 29, 1))
+grid(True)
+plt.xlabel('FABRUARY')
+plt.title('SSMIS - zone2')
+fig.show()
+
+## JUNE ##
+fig=plt.figure()
+plt.plot(arange(0,30,1),tb17_JUN_anom,label='91.66Ghz-V',c='r')
+plt.plot(arange(0,30,1),tb18_JUN_anom,label='91.66GHz-H',c='b')
+plt.plot(arange(0,31,1),np.zeros([31]),'--',c='k')
+ylabel('Tb anomaly')
+legend()
+twinx().plot(arange(0,30,1),ts17_JUN_moy,label='surface temperature',c='g')
+ylabel('surface temperature')
+plt.xticks(arange(0, 30, 1), arange(1, 31, 1))
+grid(True)
+plt.title('SSMIS - JUNE 2010')
+fig.show()
+
+
+
+
+################
+# CARTOGRAPHIE #
+################
+## Etude sur l'Antarctique ##
+dx=5.
+dy=5.
+x0, x1 = -180, 180
+y0, y1 = -90, -30
+
+
+## FEBRUARY ##
+bbtb_ch17_FEB = nonzero((tb17_FEB != -500.) & (tb17_FEB != 0.))
+OUTZCH17_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),28], 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)
+for ijr in range(0,28):
+    print 'jour=', ijr+1
+    ## ch17 ##
+    ind_jr17_FEB = np.where(jjr17_FEB[bbtb_ch17_FEB] == ijr+1)[0]
+    xx = lon17_FEB[bbtb_ch17_FEB][ind_jr17_FEB]
+    yy = lat17_FEB[bbtb_ch17_FEB][ind_jr17_FEB]
+    zz = tb17_FEB[bbtb_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[:,:]
+
+## APRIL ##
+bbtb_ch17_APR = nonzero((tb17_APR != -500.) & (tb17_APR != 0.))
+OUTZCH17_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], 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)
+for ijr in range(0,30):
+    print 'jour=', ijr+1
+    ## ch17 ##
+    ind_jr17_APR = np.where(jjr17_APR[bbtb_ch17_APR] == ijr+1)[0]
+    xx = lon17_APR[bbtb_ch17_APR][ind_jr17_APR]
+    yy = lat17_APR[bbtb_ch17_APR][ind_jr17_APR]
+    zz = tb17_APR[bbtb_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[:,:]
+
+## MAY ##
+bbtb_ch17_MAY = nonzero((tb17_MAY != -500.) & (tb17_MAY != 0.))
+OUTZCH17_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),31], float)
+outzch17_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch17_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch17_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range(0,31):
+    print 'jour=', ijr+1
+    ## ch17 ##
+    ind_jr17_MAY = np.where(jjr17_MAY[bbtb_ch17_MAY] == ijr+1)[0]
+    xx = lon17_MAY[bbtb_ch17_MAY][ind_jr17_MAY]
+    yy = lat17_MAY[bbtb_ch17_MAY][ind_jr17_MAY]
+    zz = tb17_MAY[bbtb_ch17_MAY][ind_jr17_MAY]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch17_MAY = outz
+    lonch17_MAY = outx
+    latch17_MAY = outy
+    OUTZCH17_MAY[:,:,ijr] = outzch17_MAY[:,:]
+
+## JUNE ##
+## ch17 ##
+bbtb_ch17_JUN = nonzero((tb17_JUN != -500.) & (tb17_JUN != 0.))
+OUTZCH17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float)
+outzch17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch17_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch17_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch18 ##
+bbemis_ch18_JUN=nonzero((emis18_JUN!=-500.)&(emis18_JUN<1.)&(emis18_JUN>0.))
+bbtb_ch18_JUN=nonzero((tb18_JUN!=-500.)&(tb18_JUN!=0.))
+OUTZCH18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float)
+outzch18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch18_JUN=np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch18_JUN=np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range(0,30):
+    print 'jour=', ijr+1
+    ## ch17 ##
+    ind_jr17_JUN = np.where(jjr17_JUN[bbtb_ch17_JUN] == ijr+1)[0]
+    xx = lon17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
+    yy = lat17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
+    zz = tb17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch17_JUN = outz
+    lonch17_JUN = outx
+    latch17_JUN = outy
+    OUTZCH17_JUN[:,:,ijr] = outzch17_JUN[:,:]
+    ## ch18 ##
+    ind_jr18_JUN = np.where(jjr18_JUN[bbtb_ch18_JUN] == ijr+1)[0]
+    xx = lon18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
+    yy = lat18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
+    zz = tb18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch18_JUN = outz
+    lonch18_JUN = outx
+    latch18_JUN = outy
+    OUTZCH18_JUN[:,:,ijr] = outzch18_JUN[:,:]
+
+## JULY ##
+bbtb_ch17_JUL = nonzero((tb17_JUL != -500.) & (tb17_JUL != 0.))
+OUTZCH17_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),31], 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)
+for ijr in range(0,31):
+    print 'jour=', ijr+1
+    ## ch17 ##
+    ind_jr17_JUL = np.where(jjr17_JUL[bbtb_ch17_JUL] == ijr+1)[0]
+    xx = lon17_JUL[bbtb_ch17_JUL][ind_jr17_JUL]
+    yy = lat17_JUL[bbtb_ch17_JUL][ind_jr17_JUL]
+    zz = tb17_JUL[bbtb_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[:,:]
+
+
+## calcul de la climatologie moyenne sur le mois et anomalie en chaque lon/lat ##
+## FEBRUARY ##
+mean_outzch17_FEB = np.zeros([len(latch17_FEB), len(lonch17_FEB)], float)
+for ilon in range (0,len(lonch17_FEB)):
+    for ilat in range (0,len(latch17_FEB)):
+        mean_outzch17_FEB[ilat,ilon] = mean(OUTZCH17_FEB[ilat,ilon,:])
+
+tbch17_anom_FEB = np.zeros([len(latch17_FEB),len(lonch17_FEB),28], float)
+for ijr in range (0,28):
+    tbch17_anom_FEB[:,:,ijr] = OUTZCH17_FEB[:,:,ijr] - mean_outzch17_FEB[:,:]
+
+## APRIL ##
+mean_outzch17_APR = np.zeros([len(latch17_APR), len(lonch17_APR)], float)
+for ilon in range (0,len(lonch17_APR)):
+    for ilat in range (0,len(latch17_APR)):
+        mean_outzch17_APR[ilat,ilon] = mean(OUTZCH17_APR[ilat,ilon,:])
+
+tbch17_anom_APR = np.zeros([len(latch17_APR),len(lonch17_APR),30], float)
+for ijr in range (0,30):
+    tbch17_anom_APR[:,:,ijr] = OUTZCH17_APR[:,:,ijr] - mean_outzch17_APR[:,:]
+
+## MAY ##
+mean_outzch17_MAY = np.zeros([len(latch17_MAY), len(lonch17_MAY)], float)
+for ilon in range (0,len(lonch17_MAY)):
+    for ilat in range (0,len(latch17_MAY)):
+        mean_outzch17_MAY[ilat,ilon] = mean(OUTZCH17_MAY[ilat,ilon,:])
+
+tbch17_anom_MAY = np.zeros([len(latch17_MAY),len(lonch17_MAY),31], float)
+for ijr in range (0,31):
+    tbch17_anom_MAY[:,:,ijr] = OUTZCH17_MAY[:,:,ijr] - mean_outzch17_MAY[:,:]
+
+
+## JUNE ##
+## ch17 ##
+mean_outzch17_JUN = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float)
+for ilon in range (0,len(lonch17_JUN)):
+    for ilat in range (0,len(latch17_JUN)):
+        mean_outzch17_JUN[ilat,ilon] = OUTZCH17_JUN[ilat,ilon,:].mean()
+
+tbch17_anom_JUN = np.zeros([len(latch17_JUN),len(lonch17_JUN),30], float)
+for ijr in range (0,30):
+    tbch17_anom_JUN[:,:,ijr] = OUTZCH17_JUN[:,:,ijr] - mean_outzch17_JUN[:,:]
+
+## ch18 ##
+mean_outzch18_JUN = np.zeros([len(latch18_JUN), len(lonch18_JUN)], float)
+for ilon in range (0,len(lonch18_JUN)):
+    for ilat in range (0,len(latch18_JUN)):
+        mean_outzch18_JUN[ilat,ilon] = OUTZCH18_JUN[ilat,ilon,:].mean()
+
+tbch18_anom_JUN = np.zeros([len(latch18_JUN),len(lonch18_JUN),30], float)
+for ijr in range (0,30):
+    tbch18_anom_JUN[:,:,ijr] = OUTZCH18_JUN[:,:,ijr] - mean_outzch18_JUN[:,:]
+
+
+
+for ijr in range (23, 30):
+     figure()
+     plt.ion()
+     m = Basemap(llcrnrlon=-60, urcrnrlon=-40, llcrnrlat=-85, urcrnrlat=-75, projection='cyl', resolution='c', fix_aspect=True)
+     m.drawcoastlines(linewidth = 1)
+     m.drawparallels(np.arange(-85., 75., 2))
+     m.drawmeridians(np.arange(-60., -40., 2))
+     #m.fillcontinents()
+     clevs = arange(-25., 5., 0.1)
+     xii,yii = m(*np.meshgrid(lonch17_JUN, latch17_JUN))
+     cs = m.contourf(xii, yii, tbch17_anom_JUN[:,:,ijr], clevs, cmap=cm.s3pcpn_l_r)
+     cbar = colorbar(cs)
+     cbar.set_label('Tb anomaly SSMIS CH17 - JUNE')
+     xticks(np.arange(-60., -40., 2))
+     yticks(np.arange(-85., 75., 2))
+     plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/SSMIS/mean_tb_anomaly_map_'+str(ijr+1)+'JUN_ch17_SSMIS_Zoom_zone2')
+
+
+figure()
+plt.ion()
+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))
+#m.fillcontinents()
+xii,yii = m(*np.meshgrid(lonch17_FEB, latch17_FEB))
+plt.xticks(arange(-180, 200, 20))
+plt.yticks(arange(-90, -30, 20))
+## ch17 ##
+clevs = arange(150., 270., 1.)
+cs = m.contourf(xii, yii, mean_outzch17_FEB, clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('Mean Tb FEB [CH17] - SSMIS')
+## BIAIS ch17-ch18 ## 
+biais_JUN = mean_outzch17_JUN - mean_outzch18_JUN
+clevs = arange(0., 45., 1.)
+cs = m.contourf(xii, yii, biais_JUN, clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('Bias [CH17-CH18] of Mean Tb JUNE - SSMIS')
+
+## VARIANCE ch17 - ch18 ##
+std1 = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float)
+for ilat in range (0, len(latch17_JUN)):
+    for ilon in range (0, len(lonch17_JUN)):
+        std1[ilat, ilon] = (mean_outzch17_JUN[ilat, ilon]**2)-(mean_outzch18_JUN[ilat, ilon]**2)
+
+
+N = len(lonch17_JUN)*len(latch17_JUN)
+std_JUN = std1/N
+clevs = arange(0., 25., 0.1)
+cs = m.contourf(xii, yii, std_JUN, clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('Stantard deviation [CH17-CH18] of Mean Tb JUNE - SSMIS')
+
+
+
+##########################
+# DIAGRAMME DE HOVMOLLER #
+##########################
+# shape(tbch17_anom_JUN) = [ilat, ilon, ijr]
+## FEBRUARY ##
+bbtranche17_FEB = nonzero((latch17_FEB >= -85.) & (latch17_FEB <= -75))
+mean_tbch17_anom_FEB = np.zeros([len(lonch17_FEB), 28], float)
+for ilon in range (0, len(lonch17_FEB)):
+    for ijr in range (0,28):
+        mean_tbch17_anom_FEB[ilon,ijr] = mean(tbch17_anom_FEB[bbtranche17_FEB][:,ilon,ijr])
+
+y_time, x_space = np.meshgrid(arange(0,28,1), lonch17_FEB)
+fig = plt.figure()
+plt.pcolor(x_space, y_time, mean_tbch17_anom_FEB, cmap=cm.s3pcpn_l_r, vmin = -10., vmax = 15.)
+plt.axis([-180., 180., 0, 28])
+cb = plt.colorbar()
+cb.set_label('Tb anomaly - SSMIS CH17')
+plt.xticks(arange(-180.,200.,40))
+plt.yticks(arange(0, 28, 1), arange (1, 29, 1))
+plt.xlabel('longitude')
+plt.ylabel('FEBRUARY 2010')
+
+## MAY ##
+bbtranche17_MAY = nonzero((latch17_MAY >= -85.) & (latch17_MAY <= -75))
+mean_tbch17_anom_MAY = np.zeros([len(lonch17_MAY), 31], float)
+for ilon in range (0, len(lonch17_MAY)):
+    for ijr in range (0,31):
+        mean_tbch17_anom_MAY[ilon,ijr] = mean(tbch17_anom_MAY[bbtranche17_MAY][:,ilon,ijr])
+
+y_time, x_space = np.meshgrid(arange(0,31,1), lonch17_MAY)
+fig = plt.figure()
+plt.pcolor(x_space, y_time, mean_tbch17_anom_MAY, cmap=cm.s3pcpn_l_r, vmin = -12., vmax = 25.)
+plt.axis([-180., 180., 0, 30])
+cb = plt.colorbar()
+cb.set_label('Tb anomaly - SSMIS CH17')
+plt.xticks(arange(-180.,200.,40))
+plt.yticks(arange(0, 30, 1), arange(1,31,1))
+plt.xlabel('longitude')
+plt.ylabel('MAY 2010')
+
+## JUNE ##
+bbtranche17_JUN = nonzero((latch17_JUN >= -85.) & (latch17_JUN <= -75))
+mean_tbch17_anom_JUN = np.zeros([len(lonch17_JUN), 30], float)
+for ilon in range (0, len(lonch17_JUN)):
+    for ijr in range (0,30):
+        mean_tbch17_anom_JUN[ilon,ijr] = tbch17_anom_JUN[bbtranche17_JUN][:,ilon,ijr].mean()
+
+
+y_time, x_space = np.meshgrid(arange(0,30,1), lonch17_APR)
+fig = plt.figure()
+plt.pcolor(x_space, y_time, mean_tbch17_anom_APR, cmap=cm.s3pcpn_l_r, vmin = -30., vmax = 25.)
+plt.axis([-180., 180., 0, 29])
+cb = plt.colorbar()
+cb.set_label('Tb anomaly - SSMIS CH17')
+plt.xticks(arange(-180.,220.,40))
+plt.yticks(arange(0, 30, 1), arange(1,31,1))
+plt.xlabel('longitude')
+plt.ylabel('JUNE 2010')
+
Index: /trunk/src/scripts_Laura/cartesian_grid_test.py
===================================================================
--- /trunk/src/scripts_Laura/cartesian_grid_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/cartesian_grid_test.py	(revision 30)
@@ -0,0 +1,193 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import string
+import numpy as np
+import matplotlib.pyplot as plt
+import ffgrid2
+from pylab import *
+from mpl_toolkits.basemap import Basemap
+from mpl_toolkits.basemap import shiftgrid, cm
+import draw_map
+
+
+
+###############
+# test values #
+###############
+longi = array([-109.208, -117.39 , -117.928, -123.927, -120.325, -128.82 , -125.947, -122.596, -133.173, -124.778, -137.312, -134.984, -132.538, -129.883, -126.898, -136.826, -134.414, -131.833, -128.978, -141.05 , -138.707, -136.313, -133.787, -131.036, -127.931, -140.634, -138.243, -135.757, -133.087, -130.122, -126.704, -110.352, -142.613, -140.213, -137.751, -135.144, -132.291, -129.058, -125.246, -114.38 , -147.118, -144.65 , -142.229, -139.777, -137.216, -134.453, -131.372, -127.803, -118.005, -146.753])
+
+lati = array([ 68.164,  69.205,  70.121,  70.087,  70.422,  69.994,  70.359, 70.709,  69.846,  70.983,  69.619,  70.061,  70.474,  70.867, 71.246,  70.259,  70.693,  71.103,  71.496,  69.936,  70.437, 70.896,  71.325,  71.735,  72.129,  70.593,  71.08 ,  71.532, 71.959,  72.369,  72.764,  73.708,  70.723,  71.244,  71.721, 72.168,  72.595,  73.007,  73.403,  74.075,  70.188,  70.824, 71.384,  71.891,  72.361,  72.807,  73.235,  73.648,  74.394, 70.892])
+
+z = array([ 0.938 ,  0.899 ,  0.958 ,  0.944 ,  0.991 ,  0.867 ,  0.948 , 0.963 ,  0.911 ,  0.978 ,  0.935 ,  0.932 ,  0.957 ,  0.972 , 0.983 ,  0.945 ,  0.941 ,  0.965 ,  0.986 ,  0.88  ,  0.942 , 0.945 ,  0.966 ,  0.989 ,  0.9999,  0.914 ,  0.908 ,  0.93  , 0.96  ,  0.996 ,  0.9999,  0.952 ,  0.898 ,  0.88  ,  0.852 , 0.86  ,  0.906 ,  0.984 ,  0.976 ,  0.888 ,  0.794 ,  0.89  , 0.846 ,  0.849 ,  0.869 ,  0.812 ,  0.764 ,  0.904 ,  0.853 , 0.934 ])
+z0 = min(z)
+z1 = max(z)
+
+
+####################################################
+# from polar (lon, lat) to cartesian coords (x, y) #
+####################################################
+# associates a (x, y) couple to each point of (longitude, latitude) coordinates 
+# origin of the (x, y) grid : (x=0, y=0) <=> (lon=0, lat=0) 
+Rt = 6371.
+alpha = (pi*Rt)/180.
+beta = pi/180.
+# definition of theta angle and coord x,y #
+x = np.zeros([len(lati), len(longi)], float)
+y = np.zeros([len(lati), len(longi)], float)
+for ilat in range (0, len(lati)):
+    for ilon in range (0, len(longi)):
+        if ((longi[ilon] >= 0.) & (longi[ilon] <= 90.)): # 4eme quadrant
+            theta = (90. - longi[ilon]) * beta
+            x[ilat, ilon] = (90. - lati[ilat]) * alpha * cos(theta)
+            y[ilat, ilon] = (90. - lati[ilat]) * alpha * sin(-theta)
+        else:
+            if ((longi[ilon] > 90.) & (longi[ilon] <= 180.)): # 1er quadrant
+                theta = (longi[ilon] - 90.) * beta
+                x[ilat, ilon] = (90. - lati[ilat]) * alpha * cos(theta)
+                y[ilat, ilon] = (90. - lati[ilat]) * alpha * sin(theta)
+            else: 
+                if ((longi[ilon] >= -180.) & (longi[ilon] < 0.)): # 2eme et 3eme quadrants
+                    theta = (270. + longi[ilon]) * beta
+                    x[ilat, ilon] = (90. - lati[ilat]) * alpha * cos(theta)
+                    y[ilat, ilon] = (90. - lati[ilat]) * alpha * sin(theta)
+
+
+# definition of the new cartesian grid (x, y) #
+Sx = size(x)
+Sy = size(y)
+xx = reshape(x, size(x))
+yy = reshape(y, size(y))
+mx = min(xx)
+Mx = max(xx)
+my = min(yy)
+My = max(yy)
+
+x0 = round(mx) - 50. # xmin
+x1 = round(Mx) + 50. # xmax
+dx = 25. # delta(x)
+xvec = np.arange(x0, x1+dx, dx)
+nx = size(xvec)
+y0 = round(my) - 50. # ymin
+y1 = round(My) + 50. # ymax
+dy = 25. # delta(y)
+yvec = np.arange(y0, y1+dy, dy)
+ny = size(yvec)
+xgrid_cart, ygrid_cart = np.meshgrid(xvec, yvec) # new cartesian grid (centered on North pole)
+
+
+# counting each grid cell #
+ix = np.zeros([Sx], int)
+for i in range (0, Sx): # boucle sur les points M (abscisses)
+    if xx[i] == x0:
+        ix[i] = 0
+    else:
+        ix[i] = math.ceil((xx[i] - x0) / dx) - 1
+
+iy = np.zeros([Sy], int) 
+for j in range (0, Sy): # boucle sur les points M (ordonnees)
+    if yy[j] == y0:
+        iy[j] = 0
+    else:
+        iy[j] = math.ceil((yy[j] - y0) / dy) - 1 
+
+
+#inx = (ix >= 0) & (ix < nx)
+#iny = (iy >= 0) & (iy < ny)
+#inz = (z > z0) & (z < z1)
+#inn = inx & iny & inz
+#iix = ix[inn]
+#iiy = iy[inn]
+#zz = z[inn]
+
+
+
+
+# calculation of distances between point M(x,y) and 4 grid points of its belonging cell #
+dist1 = np.zeros([Sx], float)
+dist2 = np.zeros([Sx], float)
+dist3 = np.zeros([Sx], float)
+dist4 = np.zeros([Sx], float)
+min_dist = np.zeros([Sx], float)
+for k in range (0, Sx): # boucle sur les points M (x et y)
+    dist1[k] = sqrt(((xx[k] - xvec[ix[k]]) ** 2) + ((yy[k] - yvec[iy[k]]) ** 2))
+    dist2[k] = sqrt(((xx[k] - xvec[ix[k] + 1]) ** 2) + ((yy[k] - yvec[iy[k]]) ** 2))
+    dist3[k] = sqrt(((xx[k] - xvec[ix[k]])**2) + ((yy[k] - yvec[iy[k] + 1]) ** 2))
+    dist4[k] = sqrt(((xx[k] - xvec[ix[k] + 1]) ** 2) + ((yy[k] - yvec[iy[k] + 1]) ** 2))
+    dist_vec = np.array([dist1[k], dist2[k], dist3[k], dist4[k]])
+    ind = np.where(dist_vec == min(dist_vec))
+    print 'grid cell no : ' + str(ind[0][0]+1)
+    
+
+##### probleme: z pas la mÃªme dimension (plus petite)!!#######
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for i in range (0, 5):
+    np.where((xx - xvec[i]) <= dx)
+        
+    for j in range (0, len(yy)):
+        np.where ((xx[i] - xvec) <= dx):
+        print 'ok'
+        else:
+            print 'not ok'
+        np.where((yy[i] - yvec) <= dy)
+
+
+
+M = np.array([xx, yy])
+for k in range (0, len(xx)):
+    xcoord[k] = M[:,k][0]
+    ycoord[k] = M[:,k][1]
+
+
+
+
+ix = np.zeros([len(xx)], int)
+for i in range (0, len(xx)):
+    if xx[i] == x0:
+        ix[i] = 0
+    else:
+        ix[i] = math.ceil((xx[i] - x0) / dx) - 1
+
+iy = np.zeros([len(yy)], int)
+for j in range (0, len(yy)):
+    if yy[j] == y0:
+        iy[j] = 0
+    else:
+        iy[j] = math.ceil((yy[j] - y0) / dy) - 1 
+
+
+
+
+
+
+
+figure()
+m = Basemap(projection = 'npaeqd',boundinglat = 60, lon_0 = 0, resolution = 'l')
+clevs=arange(0.5, 1., 0.01)
+m.drawcoastlines(linewidth=1)
+m.drawparallels(np.arange(60, 90, 20))
+m.drawmeridians(np.arange(-180, 180, 20))
+xii,yii = m(*np.meshgrid(xx ,yy))
+cs=m.contourf(xii,yii, zgrid, clevs, cmap=cm.s3pcpn_l_r)
+cbar =colorbar(cs)
+
Index: /trunk/src/scripts_Laura/daily_diff_frequ_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/daily_diff_frequ_AMSUA_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/daily_diff_frequ_AMSUA_test.py	(revision 30)
@@ -0,0 +1,330 @@
+#!/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
+
+
+
+
+## ATTENTION: lecture des fichiers NETCDF AMSUA - definition des variables dans "read_netcdf_AMSUA_test.py" ##
+## lon
+## lat
+## jrs_MONTH
+## chan
+len_month = np.array([31, 28, 31, 30, 31, 30, 31])
+#########################
+## moyennes mensuelles ##
+#########################
+monthly_emis_JAN = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_FEB = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_MAR = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_APR = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_MAY = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_JUN = np.zeros([len(chan), len(lat), len(lon)], float)
+monthly_emis_JUL = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            monthly_emis_JAN[ich, ilat, ilon] = mean(emis_JAN[ich, ilat, ilon, :][nonzero(isnan(emis_JAN[ich, ilat, ilon, :]) == False)])
+            monthly_emis_FEB[ich, ilat, ilon] = mean(emis_FEB[ich, ilat, ilon, :][nonzero(isnan(emis_FEB[ich, ilat, ilon, :]) == False)])
+            monthly_emis_MAR[ich, ilat, ilon] = mean(emis_MAR[ich, ilat, ilon, :][nonzero(isnan(emis_MAR[ich, ilat, ilon, :]) == False)])
+            monthly_emis_APR[ich, ilat, ilon] = mean(emis_APR[ich, ilat, ilon, :][nonzero(isnan(emis_APR[ich, ilat, ilon, :]) == False)])
+            monthly_emis_MAY[ich, ilat, ilon] = mean(emis_MAY[ich, ilat, ilon, :][nonzero(isnan(emis_MAY[ich, ilat, ilon, :]) == False)])
+            monthly_emis_JUN[ich, ilat, ilon] = mean(emis_JUN[ich, ilat, ilon, :][nonzero(isnan(emis_JUN[ich, ilat, ilon, :]) == False)])
+            monthly_emis_JUL[ich, ilat, ilon] = mean(emis_JUL[ich, ilat, ilon, :][nonzero(isnan(emis_JUL[ich, ilat, ilon, :]) == False)])
+
+monthly_emis = [monthly_emis_JAN, monthly_emis_FEB, monthly_emis_MAR, monthly_emis_APR, monthly_emis_MAY, monthly_emis_JUN, monthly_emis_JUL]
+
+##############################
+## plot moyennes mensuelles ##
+##############################
+## evolution de l'emissivite moyenne mensuelle dans une tranche de latitude ##
+plt.ion()
+for ilat in range (2, 7):
+    plt.figure()
+    plt.plot(lon, monthly_emis_JAN[0, ilat, :], 'r--', label = 'JAN')
+    plt.plot(lon, monthly_emis_FEB[0, ilat, :], 'g--', label = 'FEB')
+    plt.plot(lon, monthly_emis_MAR[0, ilat, :], 'b--', label = 'MAR')
+    plt.plot(lon, monthly_emis_APR[0, ilat, :], 'm', label = 'APR')
+    plt.plot(lon, monthly_emis_MAY[0, ilat, :], 'y', label = 'MAY')
+    plt.plot(lon, monthly_emis_JUN[0, ilat, :], 'k', label = 'JUN')
+    plt.plot(lon, monthly_emis_JUL[0, ilat, :], 'c', label = 'JUL')
+    plt.xticks(np.arange(-180, 200, 20), rotation = 45)
+    legend(bbox_to_anchor = (0., 1.02, 1., 0.01), loc = 3, ncol = 7)
+    plt.ylabel('emissivity')
+    plt.xlabel('longitude')
+    plt.title('latitude: ' + str(lat[ilat]) + ' - CH1 - AMSUA')
+    grid(True)
+    plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/AMSUA/emis_lon_lat' + str(lat[ilat]) + '_plt_FEB-APR-JUL_ch1_AMSUA.png')
+
+
+## evolution biais dans une tranche de latitude ##
+plt.figure()
+lat_color = np.array(['r', 'm', 'b', 'g', 'c'])
+for ilat in range (2, 7):
+    plt.plot(lon, (monthly_emis_JAN[0, ilat, :] / monthly_emis_JUL[0, ilat, :]), lat_color[ilat-2], label = str(lat[ilat]))
+
+legend(bbox_to_anchor = (0., 1.04), loc = 3, ncol = 5)
+plt.xticks(np.arange(-180, 200, 20), rotation = 45)
+plt.ylabel('emissivity bias')
+plt.xlabel('longitude')
+grid(True)
+plt.title('emiss(JAN)/emiss(JUL)')
+plt.plot(lon, np.ones([len(lon)]), 'k--')
+
+
+################
+## emissivite ##
+################
+Njr = np.sum(len_month)
+emis_glob = np.zeros([len(chan), len(lat), len(lon), Njr], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            e1 = np.append(emis_JAN[ich, ilat, ilon, :], emis_FEB[ich, ilat, ilon, :])
+            e2 = np.append(e1, emis_MAR[ich, ilat, ilon, :])
+            e3 = np.append(e2, emis_APR[ich, ilat, ilon, :])
+            e4 = np.append(e3, emis_MAY[ich, ilat, ilon, :])
+            e5 = np.append(e4, emis_JUN[ich, ilat, ilon, :])
+            e6 = np.append(e5, emis_JUL[ich, ilat, ilon, :])
+            emis_glob[ich, ilat, ilon, :] = e6
+
+y_time, x_space = np.meshgrid(arange(0, Njr, 1), lon)
+for ilat in range (2, 7):
+    plt.figure()
+    plt.title('emissivity - AMSUA - latitude ' + str(lat[ilat]))
+    for ich in range (0, len(chan)):
+        plt.subplot(2, 1, ich+1)
+        plt.pcolor(x_space, y_time, emis_glob[ich, ilat, :, :], cmap=cm.s3pcpn_l_r, vmin = 0.5, vmax = 0.95)
+        plt.axis([-180., 180., 0, Njr])
+        cb = plt.colorbar()
+        cb.set_label('CH ' + str(chan[ich]) + 'GHz')
+        plt.yticks(np.array([0, 31, 59, 90, 120, 151, 181]), np.array(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL']))
+        plt.xticks(np.arange(-180, 200, 20), rotation = 30)
+        plt.grid(True)
+        plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/AMSUA/hov_emis_lat' + str(lat[ilat]) + '_ch1-ch15_AMSUA.png')
+
+
+
+#########################
+## anomalie emissivite ##
+#########################
+emis_anom_glob = np.zeros([len(chan), len(lat), len(lon), Njr], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            for indjr in range (15, Njr - 15): # moyenne glissante centree
+                emis_anom_glob[ich, ilat, ilon, indjr] = emis_glob[ich, ilat, ilon, indjr][nonzero(emis_glob[ich, ilat, ilon, indjr] != 0.)] - mean(emis_glob[ich, ilat, ilon, indjr - 15 : indjr + 15][nonzero(emis_glob[ich, ilat, ilon, indjr - 15 : indjr + 15] != 0.)])
+
+
+
+###################################################################
+## variation saisonniÃšre emissivite en fonction de type de glace ##
+###################################################################
+
+#### definition des zones d etaude ####
+
+# zone1 et 2 = lon ([30E - 70E] et [90E - 160E]) tranche de lat [70S]
+lat1 = np.where(lat == -70.)[0][0]
+lon1 = np.where(lon == 30.)[0][0]
+lon2 = np.where(lon == 75.)[0][0]
+lon3 = np.where(lon == 90.)[0][0]
+lon4 = np.where(lon == 165.)[0][0]
+# zone3 = lon ([100W - 80W] tranche de lat [80S]
+lat2 = np.where(lat == -80.)[0][0]
+lon5 = np.where(lon == -100.)[0][0]
+lon6 = np.where(lon == -75.)[0][0]
+# zone4 = lon ([20W - 20E] tranche de lat [75S]
+lat3 = np.where(lat == -75.)[0][0]
+lon7 = np.where(lon == -20.)[0][0]
+lon8 = np.where(lon == 25.)[0][0]
+# zone5 = lon ([90E - 160E] tranche de lat [80S]
+lon3 = np.where(lon == 90.)[0][0]
+lon4 = np.where(lon == 165.)[0][0]
+# zone6 = lon ([180W - 160W] tranche de lat [75S]
+lon9 = np.where(lon == -180.)[0][0]
+lon10 = np.where(lon == -155.)[0][0]
+# zone7 = lon ([180E - 160E] tranche de lat [80S]
+lon11 = np.where(lon == 160.)[0][0]
+lon12 = np.where(lon == 180.)[0][0]
+# zone8 = lon ([180E - 160E] tranche de lat [75S]
+lon11 = np.where(lon == 160.)[0][0]
+lon12 = np.where(lon == 180.)[0][0]
+# zone9 = lon ([40E - 90E] tranche de lat [80S]
+lon13 = np.where(lon == 40.)[0][0]
+lon14 = np.where(lon == 95.)[0][0]
+# zone10 = lon ([120W - 140W] tranche de lat [80S]
+lon15 = np.where(lon == -140.)[0][0]
+lon16 = np.where(lon == -115.)[0][0]
+
+#### emissivite ####
+
+emis_glob_jr = np.zeros([len(chan), Njr], float)
+for ich in range (0, len(chan)):
+    for indjr in range (0, Njr):
+        emis_glob_jr[ich, indjr] = mean(emis_glob[ich, lat2, lon3 : lon4, indjr])
+
+
+plt.ion()
+plt.figure()
+color_chan = np.array(['b', 'r'])
+for ich in range (0, len(chan)):
+    plt.plot(emis_glob_jr[ich, :][nonzero(emis_glob_jr[ich, :] != 0.)], color_chan[ich], label = str(chan[ich]) + 'GHz')
+
+legend(loc = 4)
+plt.xlim(0, 212)
+plt.xticks(np.array([0, 31, 59, 90, 120, 151, 181]), np.array(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL']), rotation = 30)
+plt.ylabel('emissivitty')
+grid(True)
+plt.title('Seasonal variation of emissivity - zone[120W-140W;80S] - AMSUA (nadir)')
+
+#### anomalie d emissivite (sur une moyenne glissante) ####
+
+emis_anom_glob_jr = np.zeros([len(chan), Njr], float)
+for ich in range (0, len(chan)):
+    for indjr in range (0, Njr):
+        emis_anom_glob_jr[ich, indjr] = mean(emis_anom_glob[ich, lat3, lon11 : lon12, indjr][nonzero(isnan(emis_anom_glob[ich, lat3, lon11 : lon12, indjr]) == False)])
+
+
+plt.ion()
+plt.figure()
+color_chan = np.array(['b', 'r'])
+for ich in range (0, len(chan)):
+    plt.plot(emis_anom_glob_jr[ich, :], color_chan[ich], label = str(chan[ich]) + 'GHz')
+
+legend(loc = 4)
+plt.xlim(0, 212)
+plt.xticks(np.array([0, 31, 59, 90, 120, 151, 181]), np.array(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL']), rotation = 30)
+plt.ylabel('emissivity anomaly')
+grid(True)
+plt.title('Seasonal variation of emissivity anomaly - zone[30E-70E;70S] - AMSUA (nadir)')
+
+#### gradient de frequence ####
+
+monthly_emis = np.array([monthly_emis_JAN, monthly_emis_FEB, monthly_emis_MAR, monthly_emis_APR, monthly_emis_MAY, monthly_emis_JUN, monthly_emis_JUL])
+monthly_emis_mo = np.zeros([len(month), len(chan)], float)
+for imo in range (0, len(month)):
+    for ich in range(0, len(chan)):
+        monthly_emis_mo[imo, ich] = mean(monthly_emis[imo, ich, lat2, lon15 : lon16])
+
+
+monthly_emis_diff = monthly_emis_mo[:, 0] / monthly_emis_mo[:, 1]
+
+
+plt.ion()
+plt.figure()
+color_chan = np.array(['b', 'r'])
+subplot(2,1,1)
+for ich in range (0, len(chan)):
+    plt.plot(monthly_emis_mo[:, ich], color_chan[ich], label = str(chan[ich]) + 'GHz')
+
+plt.ylabel('emissivity')
+legend(loc = 4)
+grid(True)
+plt.title('Seasonal emissivity bias - zone[140W-120W;80S] - AMSUA (nadir)')
+plt.xticks(np.arange(0, 7, 1), np.array(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL']), rotation = 30)
+subplot(2,1,2)
+plot(monthly_emis_diff, 'k', label = 'bias')
+plot(np.ones([len(month)]), 'g--')
+plt.ylabel('bias (CH1/CH15)')
+plt.xticks(np.arange(0, 7, 1), np.array(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL']), rotation = 30)
+grid(True)
+
+
+
+
+###############################
+## biais emissivite par mois ##
+###############################
+biais_month = np.zeros([len(month), len(lat), len(lon)], float)
+for imo in range (0, len(month)):
+    biais_month[imo, :, :] = monthly_emis[imo][0, :, :] - monthly_emis[imo][1, :, :]
+
+for imo in range (0, len(month)):
+    plt.figure()
+    plt.title('AMSUA [CH1-CH2] - '+str(month[imo])+' - (lat -80)')
+    vlines(lon, [0], biais_month[imo, 2, :])
+    xlabel('longitude')
+    ylabel('bias(emissivity)')
+    xlim(-180, 180)
+    xticks(np.arange(-180., 200., 20), rotation = 30)
+    grid(True)
+    plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/AMSUA/vlines_bias_emis_ch1-ch15_lat-80_'+str(month[imo])+'_AMSUA.png')
+
+
+#############################
+## var emissivite par mois ##
+#############################
+var = np.zeros([len(lat), len(lon)], float)
+for ilon in range (0, len(lon)):
+    for ilat in range (0, len(lat)):
+        var[ilat, ilon] = np.sum((biais_month[:, ilat, ilon] - mean(biais_month[:, ilat, ilon]))**2)
+
+var = var/7
+for ilat in range (2, 7):
+    plt.figure()
+    vlines(lon, [0], var[ilat, :])
+    xlabel('longitude')
+    ylabel('var(emiss_bias)')
+    plt.title('AMSUA [CH1-CH2] - lat '+str(lat[ilat]) )
+    xlim(-180, 180)
+    xticks(np.arange(-180., 200., 20), rotation = 30)
+    grid(True)
+    plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/AMSUA/vlines_var_bias-emis_ch1-ch15_lat-'+str(lat[ilat])+'_AMSUA.png')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+plt.figure()
+plt.ion()
+#vlines(biais_month[0, 2])
+#plt.subplot(2, 1, 1)
+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.05, 0.0001))
+cs = m.contourf(xii, yii, var, clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('CH1 - 23.8GHz')
+plt.title('var(emis) JUL - AMSUA')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+plt.subplot(2, 1, 2)
+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, var_JUL[1, :, :], clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('CH15 - 89GHz')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+
+
+
+
+
Index: /trunk/src/scripts_Laura/diff_frequ_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/diff_frequ_AMSUA_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/diff_frequ_AMSUA_test.py	(revision 30)
@@ -0,0 +1,498 @@
+#!/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([31, 28, 31, 30, 31, 30, 31])
+month = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+chan = np.array(['CH1', 'CH15'])
+################
+# CARTOGRAPHIE #
+################
+## Etude sur l'Antarctique ##
+dx = 5.
+dy = 5.
+x0, x1 = -180, 180
+y0, y1 = -90, -30
+
+
+## JANUARY ##
+imo = 0
+## ch1 ##
+fovZen_ch1_JAN = np.where(fov1_JAN == 21.)
+bbemis_ch1_JAN = nonzero((emis1_JAN[fovZen_ch1_JAN] != -500.) & (emis1_JAN[fovZen_ch1_JAN] <= 1.))
+OUTZCH1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_JAN = np.where(fov15_JAN == 21.)
+bbemis_ch15_JAN = nonzero((emis15_JAN[fovZen_ch15_JAN] != -500.) & (emis15_JAN[fovZen_ch15_JAN] <= 1.))
+OUTZCH15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_JAN = np.where(jjr1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN] == ijr+1)[0]
+    xx = lon1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN]
+    yy = lat1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN]
+    zz = emis1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_JAN = outz
+    lonch1_JAN = outx
+    latch1_JAN = outy
+    OUTZCH1_JAN[:,:,ijr] = outzch1_JAN[:,:]
+    ## ch15 ##
+    ind_jr15_JAN = np.where(jjr15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN] == ijr+1)[0]
+    xx = lon15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN]
+    yy = lat15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN]
+    zz = emis15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_JAN = outz
+    lonch15_JAN = outx
+    latch15_JAN = outy
+    OUTZCH15_JAN[:,:,ijr] = outzch15_JAN[:,:]
+
+OUTZ_JAN = np.array([OUTZCH1_JAN, OUTZCH15_JAN])
+
+
+## FEBRUARY ##
+imo = 1
+## ch1 ##
+fovZen_ch1_FEB = np.where(fov1_FEB == 21.)
+bbemis_ch1_FEB = nonzero((emis1_FEB[fovZen_ch1_FEB] != -500.) & (emis1_FEB[fovZen_ch1_FEB] <= 1.))
+OUTZCH1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_FEB = np.where(fov15_FEB == 21.)
+bbemis_ch15_FEB = nonzero((emis15_FEB[fovZen_ch15_FEB] != -500.) & (emis15_FEB[fovZen_ch15_FEB] <= 1.))
+OUTZCH15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_FEB = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_FEB = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_FEB = np.where(jjr1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB] == ijr+1)[0]
+    shape(ind_jr1_FEB)
+    xx = lon1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB]
+    yy = lat1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB]
+    zz = emis1_FEB[fovZen_ch1_FEB][bbemis_ch1_FEB][ind_jr1_FEB]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_FEB = outz
+    lonch1_FEB = outx
+    latch1_FEB = outy
+    OUTZCH1_FEB[:,:,ijr] = outzch1_FEB[:,:]
+    ## ch15 ##
+    ind_jr15_FEB = np.where(jjr15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB] == ijr+1)[0]
+    shape(ind_jr15_FEB)
+    xx = lon15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB]
+    yy = lat15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB]
+    zz = emis15_FEB[fovZen_ch15_FEB][bbemis_ch15_FEB][ind_jr15_FEB]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_FEB = outz
+    lonch15_FEB = outx
+    latch15_FEB = outy
+    OUTZCH15_FEB[:,:,ijr] = outzch15_FEB[:,:]
+
+OUTZ_FEB = np.array([OUTZCH1_FEB, OUTZCH15_FEB])
+
+## MARCH ##
+imo = 2
+## ch1 ##
+fovZen_ch1_MAR = np.where(fov1_MAR == 21.)
+bbemis_ch1_MAR = nonzero((emis1_MAR[fovZen_ch1_MAR] != -500.) & (emis1_MAR[fovZen_ch1_MAR] <= 1.))
+OUTZCH1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_MAR = np.where(fov15_MAR == 21.)
+bbemis_ch15_MAR = nonzero((emis15_MAR[fovZen_ch15_MAR] != -500.) & (emis15_MAR[fovZen_ch15_MAR] <= 1.))
+OUTZCH15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_MAR = np.where(jjr1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR] == ijr+1)[0]
+    xx = lon1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR]
+    yy = lat1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR]
+    zz = emis1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_MAR = outz
+    lonch1_MAR = outx
+    latch1_MAR = outy
+    OUTZCH1_MAR[:,:,ijr] = outzch1_MAR[:,:]
+    ## ch15 ##
+    ind_jr15_MAR = np.where(jjr15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR] == ijr+1)[0]
+    xx = lon15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR]
+    yy = lat15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR]
+    zz = emis15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_MAR = outz
+    lonch15_MAR = outx
+    latch15_MAR = outy
+    OUTZCH15_MAR[:,:,ijr] = outzch15_MAR[:,:]
+
+OUTZ_MAR = np.array([OUTZCH1_MAR, OUTZCH15_MAR])
+
+
+## APRIL ##
+imo = 3
+## ch1 ##
+fovZen_ch1_APR = np.where(fov1_APR == 21.)
+bbemis_ch1_APR = nonzero((emis1_APR[fovZen_ch1_APR] != -500.) & (emis1_APR[fovZen_ch1_APR] <= 1.))
+OUTZCH1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_APR = np.where(fov15_APR == 21.)
+bbemis_ch15_APR = nonzero((emis15_APR[fovZen_ch15_APR] != -500.) & (emis15_APR[fovZen_ch15_APR] <= 1.))
+OUTZCH15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_APR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_APR = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_APR = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_APR = np.where(jjr1_APR[fovZen_ch1_APR][bbemis_ch1_APR] == ijr+1)[0]
+    shape(ind_jr1_APR)
+    xx = lon1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR]
+    yy = lat1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR]
+    zz = emis1_APR[fovZen_ch1_APR][bbemis_ch1_APR][ind_jr1_APR]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_APR = outz
+    lonch1_APR = outx
+    latch1_APR = outy
+    OUTZCH1_APR[:,:,ijr] = outzch1_APR[:,:]
+    ## ch15 ##
+    ind_jr15_APR = np.where(jjr15_APR[fovZen_ch15_APR][bbemis_ch15_APR] == ijr+1)[0]
+    xx = lon15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR]
+    yy = lat15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR]
+    zz = emis15_APR[fovZen_ch15_APR][bbemis_ch15_APR][ind_jr15_APR]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_APR = outz
+    lonch15_APR = outx
+    latch15_APR = outy
+    OUTZCH15_APR[:,:,ijr] = outzch15_APR[:,:]
+
+OUTZ_APR = np.array([OUTZCH1_APR, OUTZCH15_APR])
+
+## MAY ##
+imo = 4
+## ch1 ##
+fovZen_ch1_MAY = np.where(fov1_MAY == 21.)
+bbemis_ch1_MAY = nonzero((emis1_MAY[fovZen_ch1_MAY] != -500.) & (emis1_MAY[fovZen_ch1_MAY] <= 1.))
+OUTZCH1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_MAY = np.where(fov15_MAY == 21.)
+bbemis_ch15_MAY = nonzero((emis15_MAY[fovZen_ch15_MAY] != -500.) & (emis15_MAY[fovZen_ch15_MAY] <= 1.))
+OUTZCH15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_MAY = np.where(jjr1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY] == ijr+1)[0]
+    xx = lon1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY]
+    yy = lat1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY]
+    zz = emis1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_MAY = outz
+    lonch1_MAY = outx
+    latch1_MAY = outy
+    OUTZCH1_MAY[:,:,ijr] = outzch1_MAY[:,:]
+    ## ch15 ##
+    ind_jr15_MAY = np.where(jjr15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY] == ijr+1)[0]
+    xx = lon15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY]
+    yy = lat15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY]
+    zz = emis15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_MAY = outz
+    lonch15_MAY = outx
+    latch15_MAY = outy
+    OUTZCH15_MAY[:,:,ijr] = outzch15_MAY[:,:]
+
+OUTZ_MAY = np.array([OUTZCH1_MAY, OUTZCH15_MAY])
+
+
+## JUNE ##
+imo = 5
+## ch1 ##
+fovZen_ch1_JUN = np.where(fov1_JUN == 21.)
+bbemis_ch1_JUN = nonzero((emis1_JUN[fovZen_ch1_JUN] != -500.) & (emis1_JUN[fovZen_ch1_JUN] <= 1.))
+OUTZCH1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_JUN = np.where(fov15_JUN == 21.)
+bbemis_ch15_JUN = nonzero((emis15_JUN[fovZen_ch15_JUN] != -500.) & (emis15_JUN[fovZen_ch15_JUN] <= 1.))
+OUTZCH15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_JUN = np.where(jjr1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN] == ijr+1)[0]
+    xx = lon1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN]
+    yy = lat1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN]
+    zz = emis1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_JUN = outz
+    lonch1_JUN = outx
+    latch1_JUN = outy
+    OUTZCH1_JUN[:,:,ijr] = outzch1_JUN[:,:]
+    ## ch15 ##
+    ind_jr15_JUN = np.where(jjr15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN] == ijr+1)[0]
+    xx = lon15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN]
+    yy = lat15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN]
+    zz = emis15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_JUN = outz
+    lonch15_JUN = outx
+    latch15_JUN = outy
+    OUTZCH15_JUN[:,:,ijr] = outzch15_JUN[:,:]
+
+OUTZ_JUN = np.array([OUTZCH1_JUN, OUTZCH15_JUN])
+
+
+## JULY ##
+imo = 6
+## ch1 ##
+fovZen_ch1_JUL = np.where(fov1_JUL == 21.)
+bbemis_ch1_JUL = nonzero((emis1_JUL[fovZen_ch1_JUL] != -500.) & (emis1_JUL[fovZen_ch1_JUL] <= 1.))
+OUTZCH1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch1_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch1_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+## ch15 ##
+fovZen_ch15_JUL = np.where(fov15_JUL == 21.)
+bbemis_ch15_JUL = nonzero((emis15_JUL[fovZen_ch15_JUL] != -500.) & (emis15_JUL[fovZen_ch15_JUL] <= 1.))
+OUTZCH15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float)
+outzch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
+lonch15_JUL = np.zeros([len(np.arange(x0, x1+1, dx))], float)
+latch15_JUL = np.zeros([len(np.arange(y0, y1+1, dy))], float)
+for ijr in range (0, len_month[imo]):
+    print 'jour=', ijr+1
+    ## ch1 ##
+    ind_jr1_JUL = np.where(jjr1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL] == ijr+1)[0]
+    xx = lon1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL]
+    yy = lat1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL]
+    zz = emis1_JUL[fovZen_ch1_JUL][bbemis_ch1_JUL][ind_jr1_JUL]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch1_JUL = outz
+    lonch1_JUL = outx
+    latch1_JUL = outy
+    OUTZCH1_JUL[:,:,ijr] = outzch1_JUL[:,:]
+    ## ch15 ##
+    ind_jr15_JUL = np.where(jjr15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL] == ijr+1)[0]
+    xx = lon15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL]
+    yy = lat15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL]
+    zz = emis15_JUL[fovZen_ch15_JUL][bbemis_ch15_JUL][ind_jr15_JUL]
+    zz0 = min(zz)
+    zz1 = max(zz)
+    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
+    outzch15_JUL = outz
+    lonch15_JUL = outx
+    latch15_JUL = outy
+    OUTZCH15_JUL[:,:,ijr] = outzch15_JUL[:,:]
+
+OUTZ_JUL = np.array([OUTZCH1_JUL, OUTZCH15_JUL])
+
+
+################################################
+## calcul de la climatologie moyenne par mois ##
+################################################
+lon = lonch1_FEB 
+lat = latch1_FEB 
+## JANUARY ##
+mean_outz_JAN = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_JAN[ich, ilat, ilon] = mean(OUTZ_JAN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JAN[ich, ilat, ilon, :]) == False)])
+
+## FEBRUARY ##
+mean_outz_FEB = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_FEB[ich, ilat, ilon] = mean(OUTZ_FEB[ich, ilat, ilon, :][nonzero(isnan(OUTZ_FEB[ich, ilat, ilon, :]) == False)])
+
+## MARCH ##
+mean_outz_MAR = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_MAR[ich, ilat, ilon] = mean(OUTZ_MAR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAR[ich, ilat, ilon, :]) == False)])
+
+## APRIL ##
+mean_outz_APR = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_APR[ich, ilat, ilon] = mean(OUTZ_APR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_APR[ich, ilat, ilon, :]) == False)])
+
+## MAY ##
+mean_outz_MAY = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_MAY[ich, ilat, ilon] = mean(OUTZ_MAY[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAY[ich, ilat, ilon, :]) == False)])
+
+## JUN ##
+mean_outz_JUN = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_JUN[ich, ilat, ilon] = mean(OUTZ_JUN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUN[ich, ilat, ilon, :]) == False)])
+
+## JULY ##
+mean_outz_JUL = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            mean_outz_JUL[ich, ilat, ilon] = mean(OUTZ_JUL[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUL[ich, ilat, ilon, :]) == False)])
+
+
+mean_outz1 = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL])
+mean_outz2 = np.array([mean_outz_JAN, mean_outz_MAR, mean_outz_MAY, mean_outz_JUN])
+
+
+
+month_red = np.array(['JANUARY', 'MARCH', 'MAY', 'JUNE'])
+for imo in range (0, 4):
+    plt.figure()
+    plt.ion()
+    for ich in range (0, len(chan)):
+        plt.subplot(2, 1, ich+1)
+        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.4, 1., 0.001))
+        cs = m.contourf(xii, yii, mean_outz2[imo, ich, :, :], clevs, cmap=cm.s3pcpn_l_r)
+        cbar = colorbar(cs)
+        cbar.set_label(chan[ich]+' - 23.8GHz - ' + month_red[imo] + ' - AMSUA')
+        xticks(arange(-180, 200, 20), rotation = 45)
+        yticks(arange(-90, -10, 20))
+
+
+######################
+## calculs de stats ##
+######################
+## FEBRUARY ##
+imo = 1
+### VARIANCE ##
+var = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            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)
+
+var_FEB = var / len_month[imo]
+
+## APRIL ##
+imo = 3
+### VARIANCE ##
+var = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            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)
+
+var_APR = var / len_month[imo]
+
+## JULY ##
+imo = 6
+### VARIANCE ##
+var = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            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)
+
+var_JUL = var / len_month[imo]
+
+
+
+
+plt.figure()
+plt.ion()
+#plt.subplot(2, 1, 1)
+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.5, 0.9, 0.001))
+cs = m.contourf(xii, yii, OUTZ_JAN[0, :, :,20], clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('CH1 - 23.8GHz')
+plt.title('var(emis) JUL - AMSUA')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+plt.subplot(2, 1, 2)
+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, var_JUL[1, :, :], clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('CH15 - 89GHz')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+
+
+
+
+
Index: /trunk/src/scripts_Laura/diff_polarsHV_SSMIS_test.py
===================================================================
--- /trunk/src/scripts_Laura/diff_polarsHV_SSMIS_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/diff_polarsHV_SSMIS_test.py	(revision 30)
@@ -0,0 +1,545 @@
+#!/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))
Index: /trunk/src/scripts_Laura/monthly_diff_frequ_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/monthly_diff_frequ_AMSUA_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/monthly_diff_frequ_AMSUA_test.py	(revision 30)
@@ -0,0 +1,157 @@
+#!/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
+
+
+## ATTENTION: lecture des fichiers NETCDF AMSUA - definition des variables dans "read_netcdf_AMSUA_test.py" ##
+## lon
+## lat
+## jrs_MONTH
+## chan
+len_month = np.array([31, 28, 31, 30, 31, 30, 31])
+
+###############################################
+## emissivite moyenne sur la periode d etude ##
+###############################################
+Njr = np.sum(len_month)
+emis_glob = np.zeros([len(chan), len(lat), len(lon), Njr], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            e1 = np.append(emis_JAN[ich, ilat, ilon, :], emis_FEB[ich, ilat, ilon, :])
+            e2 = np.append(e1, emis_MAR[ich, ilat, ilon, :])
+            e3 = np.append(e2, emis_APR[ich, ilat, ilon, :])
+            e4 = np.append(e3, emis_MAY[ich, ilat, ilon, :])
+            e5 = np.append(e4, emis_JUN[ich, ilat, ilon, :])
+            e6 = np.append(e5, emis_JUL[ich, ilat, ilon, :])
+            emis_glob[ich, ilat, ilon, :] = e6
+
+
+emis_glob_moy = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            emis_glob_moy[ich, ilat, ilon] = mean(emis_glob[ich, ilat, ilon, :][nonzero(isnan(emis_glob[ich, ilat, ilon, :]) == False)])
+
+
+
+#############################################################
+## variance de l emissivite moyenne sur la periode d etude ##
+#############################################################
+var = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            var[ich, ilat, ilon] = np.sum((emis_glob[ich, ilat, ilon, :][nonzero(isnan(emis_glob[ich, ilat, ilon, :]) == False)] - emis_glob_moy[ich, ilat, ilon])**2)
+
+
+var_glob = var / Njr
+
+
+## selection des zones en fonction de la pgade de valeur de var ##
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+#            if ((var_glob[ich, ilat, ilon] >  0.0040) & (var_glob[ich, ilat, ilon] < 0.0060)):
+#                continue
+#            if ((var_glob[ich, ilat, ilon] >=  0.0024) & (var_glob[ich, ilat, ilon] <  0.0060)):
+#                continue
+            if (var_glob[ich, ilat, ilon] <=  0.0030):
+                continue
+            else:
+                var_glob[ich, ilat, ilon] = NaN
+
+## carto ##
+plt.figure()
+plt.ion()
+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.01, 0.0001))
+cs = m.contourf(xii, yii, var_glob[0, :, :], clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('CH1 - 23.8GHz')
+plt.title('var(emis) - AMSUA')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+
+
+
+##########################################################
+## biais de l emissivite moyenne sur la periode d etude ##
+##########################################################
+
+## emis moyenne par mois ##
+emis_JAN_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_FEB_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_MAR_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_APR_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_MAY_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_JUN_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+emis_JUL_mean = np.zeros([len(chan), len(lat), len(lon)], float)
+for ich in range (0, len(chan)):
+    for ilon in range (0, len(lon)):
+        for ilat in range (0, len(lat)):
+            emis_JAN_mean[ich, ilat, ilon] = mean(emis_JAN[ich, ilat, ilon, :][nonzero(isnan(emis_JAN[ich, ilat, ilon, :]) == False)])
+            emis_FEB_mean[ich, ilat, ilon] = mean(emis_FEB[ich, ilat, ilon, :][nonzero(isnan(emis_FEB[ich, ilat, ilon, :]) == False)])
+            emis_MAR_mean[ich, ilat, ilon] = mean(emis_MAR[ich, ilat, ilon, :][nonzero(isnan(emis_MAR[ich, ilat, ilon, :]) == False)])
+            emis_APR_mean[ich, ilat, ilon] = mean(emis_APR[ich, ilat, ilon, :][nonzero(isnan(emis_APR[ich, ilat, ilon, :]) == False)])
+            emis_MAY_mean[ich, ilat, ilon] = mean(emis_MAY[ich, ilat, ilon, :][nonzero(isnan(emis_MAY[ich, ilat, ilon, :]) == False)])
+            emis_JUN_mean[ich, ilat, ilon] = mean(emis_JUN[ich, ilat, ilon, :][nonzero(isnan(emis_JUN[ich, ilat, ilon, :]) == False)])
+            emis_JUL_mean[ich, ilat, ilon] = mean(emis_JUL[ich, ilat, ilon, :][nonzero(isnan(emis_JUL[ich, ilat, ilon, :]) == False)])
+
+
+## biais ch1-ch15 ##
+bias_emis_JAN_mean = emis_JAN_mean[0, :, :] - emis_JAN_mean[1, :, :]
+bias_emis_FEB_mean = emis_FEB_mean[0, :, :] - emis_FEB_mean[1, :, :]
+bias_emis_MAR_mean = emis_MAR_mean[0, :, :] - emis_MAR_mean[1, :, :]
+bias_emis_APR_mean = emis_APR_mean[0, :, :] - emis_APR_mean[1, :, :]
+bias_emis_MAY_mean = emis_MAY_mean[0, :, :] - emis_MAY_mean[1, :, :]
+bias_emis_JUN_mean = emis_JUN_mean[0, :, :] - emis_JUN_mean[1, :, :]
+bias_emis_JUL_mean = emis_JUL_mean[0, :, :] - emis_JUL_mean[1, :, :]
+
+
+
+## carto ##
+plt.ion()
+plt.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.23, 0.18, 0.001))
+cs = m.contourf(xii, yii, bias_emis_JUL_mean[:, :], clevs, cmap=cm.s3pcpn_l_r)
+cbar = colorbar(cs)
+cbar.set_label('ch1 - ch15')
+plt.title('bias(emis) JUL - AMSUA')
+xticks(arange(-180, 200, 20), rotation = 45)
+yticks(arange(-90, -10, 20))
+
+
+## selection des zones en fonction des valeurs de biais ##
+bb0_JAN = nonzero((bias_emis_JAN_mean >= -0.01) & (bias_emis_JAN_mean <= 0.01))
+bb1_JAN = nonzero((bias_emis_JAN_mean >= 0.10))
+bb2_JAN = nonzero((bias_emis_JAN_mean <= -0.10))
+
+plt.figure()
+plt.plot(bias_emis_JAN_mean[ilat, :][bb0_JAN])
+
+for ilon in range (0, len(lon)):
+    ind = np.where((bias_emis_JAN_mean[:, ilon] >= -0.01) & (bias_emis_JAN_mean[:, ilon] <= 0.01))[0]      
+    if len(ind) == 0:
+        continue
+    else: 
+        a = ind
+        print ilon, a
+
+figure()
Index: /trunk/src/scripts_Laura/read_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/read_AMSUA_test.py	(revision 20)
+++ /trunk/src/scripts_Laura/read_AMSUA_test.py	(revision 30)
@@ -9,24 +9,129 @@
 import netCDF4
 
-################ fichiers par mois - CH1 ###################################################
-
-f1='/net/dedale/usr/dedale/surf/lelod/ANTARC/AMSUA_CH1_ANTARC_'
-f2='2010.DAT'
-date=np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
-
-numlines_month=np.zeros([7],float)
-
-for i in range (0,7):
-    f=f1+str(date[i])+f2
-    fichier=open(f,'r')
-    numlines_month[i]=0
-    for line in fichier: numlines_month[i]+=1
+################ fichiers par mois  ###################################################
+
+#########
+## CH1 ##
+#########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/AMSUA_CH1_ANTARC_'
+f2 = '2010.DAT'
+date = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+
+numlines_month = np.zeros([7],float)
+
+for i in range (0, 7):
+    print 'mois =', date[i]
+    f = f1 + str(date[i]) + f2
+    fichier = open(f,'r')
+    numlines_month[i] = 0
+    for line in fichier : numlines_month[i] += 1
 
     fichier.close()
 
 
-i=0 #JANUARY
-f=f1+str(date[i])+f2
-fichier=open(f,'r')
+i = 0 #JANUARY
+f = f1 + str(date[i]) + f2
+fichier = open(f,'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch1_JAN = amch
+lon1_JAN = amch1_JAN[0,:]
+lat1_JAN = amch1_JAN[1,:]
+jjr1_JAN = amch1_JAN[4,:]
+fov1_JAN = amch1_JAN[7,:]
+ts1_JAN = amch1_JAN[10,:]
+emis1_JAN = amch1_JAN[16,:]
+tb1_JAN = amch1_JAN[15,:]
+tup1_JAN = amch1_JAN[18,:]
+tdn1_JAN = amch1_JAN[17,:]
+trans1_JAN = amch1_JAN[19,:]
+orog1_JAN = amch1_JAN[13,:]
+
+
+i = 1 #FEBRUARY
+f = f1 + str(date[i]) + f2
+fichier = open(f,'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch1_FEB = amch
+lon1_FEB = amch1_FEB[0,:]
+lat1_FEB = amch1_FEB[1,:]
+jjr1_FEB = amch1_FEB[4,:]
+fov1_FEB = amch1_FEB[7,:]
+ts1_FEB = amch1_FEB[10,:]
+emis1_FEB = amch1_FEB[16,:]
+tb1_FEB = amch1_FEB[15,:]
+tup1_FEB = amch1_FEB[18,:]
+tdn1_FEB = amch1_FEB[17,:]
+trans1_FEB = amch1_FEB[19,:]
+orog1_FEB = amch1_FEB[13,:]
+
+
+i = 2 #MARCH
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch1_MAR = amch
+lon1_MAR = amch1_MAR[0,:]
+lat1_MAR = amch1_MAR[1,:]
+jjr1_MAR = amch1_MAR[4,:]
+fov1_MAR = amch1_MAR[7,:]
+ts1_MAR = amch1_MAR[10,:]
+emis1_MAR = amch1_MAR[16,:]
+tb1_MAR = amch1_MAR[15,:]
+tup1_MAR = amch1_MAR[18,:]
+tdn1_MAR = amch1_MAR[17,:]
+trans1_MAR = amch1_MAR[19,:]
+orog1_MAR = amch1_MAR[13,:]
+
+
+i = 3 #APRIL
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch1_APR = amch
+lon1_APR = amch1_APR[0,:]
+lat1_APR = amch1_APR[1,:]
+jjr1_APR = amch1_APR[4,:]
+fov1_APR = amch1_APR[7,:]
+ts1_APR = amch1_APR[10,:]
+emis1_APR = amch1_APR[16,:]
+tb1_APR = amch1_APR[15,:]
+tup1_APR = amch1_APR[18,:]
+tdn1_APR = amch1_APR[17,:]
+trans1_APR = amch1_APR[19,:]
+orog1_APR = amch1_APR[13,:]
+
+
+i = 4 #MAY
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
 amch=np.zeros([20,numlines_month[i]],float)
 for iligne in range (0,numlines_month[i]):
@@ -36,125 +141,10 @@
         amch[j,iligne] = float(liste[j])
 
-
-    fichier.close()
-
-
-amch1_JAN=amch
-#### def des variables 
-lon1_JAN=amch1_JAN[0,:]
-lat1_JAN=amch1_JAN[1,:]
-jjr1_JAN=amch1_JAN[4,:]
-ts1_JAN=amch1_JAN[10,:]
-emis1_JAN=amch1_JAN[16,:]
-tb1_JAN=amch1_JAN[15,:]
-tup1_JAN=amch1_JAN[18,:]
-tdn1_JAN=amch1_JAN[17,:]
-trans1_JAN=amch1_JAN[19,:]
-orog1_JAN=amch1_JAN[13,:]
-
-
-i=1 #FEBRUARY
-f=f1+str(date[i])+f2
-fichier=open(f,'r')
-amch=np.zeros([20,numlines_month[i]],float)
-for iligne in range (0,numlines_month[i]):
-    line=fichier.readline()
-    liste = line.split()
-    for j in range(0,20):
-        amch[j,iligne] = float(liste[j])
-
-
-    fichier.close()
-
-
-amch1_FEB=amch
-#### def des variables CH1 corrigees
-lon1_FEB=amch1_FEB[0,:]
-lat1_FEB=amch1_FEB[1,:]
-jjr1_FEB=amch1_FEB[4,:]
-ts1_FEB=amch1_FEB[10,:]
-emis1_FEB=amch1_FEB[16,:]
-tb1_FEB=amch1_FEB[15,:]
-tup1_FEB=amch1_FEB[18,:]
-tdn1_FEB=amch1_FEB[17,:]
-trans1_FEB=amch1_FEB[19,:]
-orog1_FEB=amch1_FEB[13,:]
-
-
-i=2 #MARCH
-f=f1+str(date[i])+f2
-fichier=open(f,'r')
-amch=np.zeros([20,numlines_month[i]],float)
-for iligne in range (0,numlines_month[i]):
-    line=fichier.readline()
-    liste = line.split()
-    for j in range(0,20):
-        amch[j,iligne] = float(liste[j])
-
-
-    fichier.close()
-
-
-amch1_MAR=amch
-#### def des variables
-lon1_MAR=amch1_MAR[0,:]
-lat1_MAR=amch1_MAR[1,:]
-jjr1_MAR=amch1_MAR[4,:]
-ts1_MAR=amch1_MAR[10,:]
-emis1_MAR=amch1_MAR[16,:]
-tb1_MAR=amch1_MAR[15,:]
-tup1_MAR=amch1_MAR[18,:]
-tdn1_MAR=amch1_MAR[17,:]
-trans1_MAR=amch1_MAR[19,:]
-orog1_MAR=amch1_MAR[13,:]
-
-
-i=3 #APRIL
-f=f1+str(date[i])+f2
-fichier=open(f,'r')
-amch=np.zeros([20,numlines_month[i]],float)
-for iligne in range (0,numlines_month[i]):
-    line=fichier.readline()
-    liste = line.split()
-    for j in range(0,20):
-        amch[j,iligne] = float(liste[j])
-
-
-    fichier.close()
-
-
-amch1_APR=amch
-#### def des variables 
-lon1_APR=amch1_APR[0,:]
-lat1_APR=amch1_APR[1,:]
-jjr1_APR=amch1_APR[4,:]
-ts1_APR=amch1_APR[10,:]
-emis1_APR=amch1_APR[16,:]
-tb1_APR=amch1_APR[15,:]
-tup1_APR=amch1_APR[18,:]
-tdn1_APR=amch1_APR[17,:]
-trans1_APR=amch1_APR[19,:]
-orog1_APR=amch1_APR[13,:]
-
-
-i=4 #MAY
-f=f1+str(date[i])+f2
-fichier=open(f,'r')
-amch=np.zeros([20,numlines_month[i]],float)
-for iligne in range (0,numlines_month[i]):
-    line=fichier.readline()
-    liste = line.split()
-    for j in range(0,20):
-        amch[j,iligne] = float(liste[j])
-
-
-    fichier.close()
-
-
+fichier.close()
 amch1_MAY=amch
-#### def des variables
 lon1_MAY=amch1_MAY[0,:]
 lat1_MAY=amch1_MAY[1,:]
 jjr1_MAY=amch1_MAY[4,:]
+fov1_MAY = amch1_MAY[7,:]
 ts1_MAY=amch1_MAY[10,:]
 emis1_MAY=amch1_MAY[16,:]
@@ -165,4 +155,5 @@
 orog1_MAY=amch1_MAY[13,:]
 
+
 i=5 #JUNE
 f=f1+str(date[i])+f2
@@ -175,13 +166,10 @@
         amch[j,iligne] = float(liste[j])
 
-
-    fichier.close()
-
-
+fichier.close()
 amch1_JUN=amch
-#### def des variables
 lon1_JUN=amch1_JUN[0,:]
 lat1_JUN=amch1_JUN[1,:]
 jjr1_JUN=amch1_JUN[4,:]
+fov1_JUN = amch1_JUN[7,:]
 ts1_JUN=amch1_JUN[10,:]
 emis1_JUN=amch1_JUN[16,:]
@@ -192,5 +180,6 @@
 orog1_JUN=amch1_JUN[13,:]
 
-i=6 #JULLY
+
+i=6 #JULY
 f=f1+str(date[i])+f2
 fichier=open(f,'r')
@@ -202,13 +191,10 @@
         amch[j,iligne] = float(liste[j])
 
-
-    fichier.close()
-
-
+fichier.close()
 amch1_JUL=amch
-#### def des variables 
 lon1_JUL=amch1_JUL[0,:]
 lat1_JUL=amch1_JUL[1,:]
 jjr1_JUL=amch1_JUL[4,:]
+fov1_JUL = amch1_JUL[7,:]
 ts1_JUL=amch1_JUL[10,:]
 emis1_JUL=amch1_JUL[16,:]
@@ -220,4 +206,197 @@
 
 
+##########
+## CH15 ##
+##########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/AMSUA_CH15_ANTARC_'
+f2 = '2010.DAT'
+date = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+
+numlines_month = np.zeros([7],float)
+
+for i in range (0, 7):
+    print 'mois =', date[i]
+    f = f1 + str(date[i]) + f2
+    fichier = open(f,'r')
+    numlines_month[i] = 0
+    for line in fichier : numlines_month[i] += 1
+
+    fichier.close()
+
+
+i = 0 #JANUARY
+f = f1 + str(date[i]) + f2
+fichier = open(f,'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_JAN = amch
+lon15_JAN = amch15_JAN[0,:]
+lat15_JAN = amch15_JAN[1,:]
+jjr15_JAN = amch15_JAN[4,:]
+fov15_JAN = amch15_JAN[7,:]
+ts15_JAN = amch15_JAN[10,:]
+emis15_JAN = amch15_JAN[16,:]
+tb15_JAN = amch15_JAN[15,:]
+tup15_JAN = amch15_JAN[18,:]
+tdn15_JAN = amch15_JAN[17,:]
+trans15_JAN = amch15_JAN[19,:]
+orog15_JAN = amch15_JAN[13,:]
+
+
+i = 1 #FEBRUARY
+f = f1 + str(date[i]) + f2
+fichier = open(f,'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_FEB = amch
+lon15_FEB = amch15_FEB[0,:]
+lat15_FEB = amch15_FEB[1,:]
+jjr15_FEB = amch15_FEB[4,:]
+fov15_FEB = amch15_FEB[7,:]
+ts15_FEB = amch15_FEB[10,:]
+emis15_FEB = amch15_FEB[16,:]
+tb15_FEB = amch15_FEB[15,:]
+tup15_FEB = amch15_FEB[18,:]
+tdn15_FEB = amch15_FEB[17,:]
+trans15_FEB = amch15_FEB[19,:]
+orog15_FEB = amch15_FEB[13,:]
+
+
+i = 2 #MARCH
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_MAR = amch
+lon15_MAR = amch15_MAR[0,:]
+lat15_MAR = amch15_MAR[1,:]
+jjr15_MAR = amch15_MAR[4,:]
+fov15_MAR = amch15_MAR[7,:]
+ts15_MAR = amch15_MAR[10,:]
+emis15_MAR = amch15_MAR[16,:]
+tb15_MAR = amch15_MAR[15,:]
+tup15_MAR = amch15_MAR[18,:]
+tdn15_MAR = amch15_MAR[17,:]
+trans15_MAR = amch15_MAR[19,:]
+orog15_MAR = amch15_MAR[13,:]
+
+
+i = 3 #APRIL
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
+amch = np.zeros([20, numlines_month[i]], float)
+for iligne in range (0, numlines_month[i]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range (0, 20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_APR = amch
+lon15_APR = amch15_APR[0,:]
+lat15_APR = amch15_APR[1,:]
+jjr15_APR = amch15_APR[4,:]
+fov15_APR = amch15_APR[7,:]
+ts15_APR = amch15_APR[10,:]
+emis15_APR = amch15_APR[16,:]
+tb15_APR = amch15_APR[15,:]
+tup15_APR = amch15_APR[18,:]
+tdn15_APR = amch15_APR[17,:]
+trans15_APR = amch15_APR[19,:]
+orog15_APR = amch15_APR[13,:]
+
+
+i = 4 #MAY
+f = f1 + str(date[i]) + f2
+fichier = open(f, 'r')
+amch=np.zeros([20,numlines_month[i]],float)
+for iligne in range (0,numlines_month[i]):
+    line=fichier.readline()
+    liste = line.split()
+    for j in range(0,20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_MAY=amch
+lon15_MAY=amch15_MAY[0,:]
+lat15_MAY=amch15_MAY[1,:]
+jjr15_MAY=amch15_MAY[4,:]
+fov15_MAY = amch15_MAY[7,:]
+ts15_MAY=amch15_MAY[10,:]
+emis15_MAY=amch15_MAY[16,:]
+tb15_MAY=amch15_MAY[15,:]
+tup15_MAY=amch15_MAY[18,:]
+tdn15_MAY=amch15_MAY[17,:]
+trans15_MAY=amch15_MAY[19,:]
+orog15_MAY=amch15_MAY[13,:]
+
+
+i=5 #JUNE
+f=f1+str(date[i])+f2
+fichier=open(f,'r')
+amch=np.zeros([20,numlines_month[i]],float)
+for iligne in range (0,numlines_month[i]):
+    line=fichier.readline()
+    liste = line.split()
+    for j in range(0,20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_JUN=amch
+lon15_JUN=amch15_JUN[0,:]
+lat15_JUN=amch15_JUN[1,:]
+jjr15_JUN=amch15_JUN[4,:]
+fov15_JUN = amch15_JUN[7,:]
+ts15_JUN=amch15_JUN[10,:]
+emis15_JUN=amch15_JUN[16,:]
+tb15_JUN=amch15_JUN[15,:]
+tup15_JUN=amch15_JUN[18,:]
+tdn15_JUN=amch15_JUN[17,:]
+trans15_JUN=amch15_JUN[19,:]
+orog15_JUN=amch15_JUN[13,:]
+
+
+i=6 #JULY
+f=f1+str(date[i])+f2
+fichier=open(f,'r')
+amch=np.zeros([20,numlines_month[i]],float)
+for iligne in range (0,numlines_month[i]):
+    line=fichier.readline()
+    liste = line.split()
+    for j in range(0,20):
+        amch[j,iligne] = float(liste[j])
+
+fichier.close()
+amch15_JUL = amch
+lon15_JUL = amch15_JUL[0,:]
+lat15_JUL = amch15_JUL[1,:]
+jjr15_JUL = amch15_JUL[4,:]
+fov15_JUL = amch15_JUL[7,:]
+ts15_JUL = amch15_JUL[10,:]
+emis15_JUL = amch15_JUL[16,:]
+tb15_JUL = amch15_JUL[15,:]
+tup15_JUL = amch15_JUL[18,:]
+tdn15_JUL = amch15_JUL[17,:]
+trans15_JUL = amch15_JUL[19,:]
+orog15_JUL = amch15_JUL[13,:]
 
 
Index: /trunk/src/scripts_Laura/read_SSMIS_test.py
===================================================================
--- /trunk/src/scripts_Laura/read_SSMIS_test.py	(revision 20)
+++ /trunk/src/scripts_Laura/read_SSMIS_test.py	(revision 30)
@@ -7,13 +7,14 @@
 from mpl_toolkits.basemap import Basemap
 from mpl_toolkits.basemap import shiftgrid, cm
-import netCDF4
+from netCDF4 import Dataset
 import ffgrid2
 
 
-################ fichiers par mois - CH1 ###################################################
+
+################ fichiers par canal - mois de juin ###################################################
+
 
 f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH'
 f3 = '_ANTARC_JUNE2010.DAT'
-#date=np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
 channel = np.array([12, 13, 15, 16, 17, 18])
 numlines = np.zeros([len(channel)],int)
@@ -26,8 +27,11 @@
      for line in fichier: numlines[ich] += 1
 
-
-     fichier.close()
-
-ich = 2 # 37GHz, H polar
+      fichier.close()
+
+
+
+
+
+ich = 0 # 37GHz, H 
 fichier = open(f1 + str(channel[ich]) + f3, 'r')
 ssmis = np.zeros([18, numlines[ich]], float)
@@ -159,5 +163,5 @@
 
 
-ich = 5 # 91.66GHz, V polar
+ich = 5 # 91.66GHz, H polar
 fichier = open(f1 + str(channel[ich]) + f3, 'r')
 ssmis = np.zeros([18, numlines[ich]], float)
@@ -184,289 +188,424 @@
 orog18_JUN=ssch18_JUN[11,:]
 
-########################
-# EVOLUTION TEMPORELLE #
-########################
-## Autour de "Dome C" (lon=123.23;lat=-75.06) - mois: JUNE ##
-## Autre zone de glace de mer / de continent (lon entre -40 et -60 // lat entre -75 et -85)## 
-## ch17 ##
-#bbzone_CH17_JUN = nonzero((lon17_JUN>=120.23)&(lon17_JUN<=126.23)&(lat17_JUN>=-78.06)&(lat17_JUN<=-72.06))
-bbzone_CH17_JUN = nonzero((lon17_JUN >= -60.) & (lon17_JUN <= -40.) & (lat17_JUN >= -85.) & (lat17_JUN <= -75.))
-emis17_JUN_moy = np.zeros([30],float)
-tb17_JUN_moy = np.zeros([30],float)
-ts17_JUN_moy = np.zeros([30],float)
-
-## ch18 ##
-#bbzone_CH18_JUN = nonzero((lon18_JUN >= 120.23) & (lon18_JUN <= 126.23) & (lat18_JUN >= -78.06) & (lat18_JUN <= -72.06))
-bbzone_CH18_JUN = nonzero((lon18_JUN >= -60.) & (lon18_JUN <= -40.) & (lat18_JUN >= -85.) & (lat18_JUN <= -75.))
-emis18_JUN_moy = np.zeros([30],float)
-tb18_JUN_moy = np.zeros([30],float)
-ts18_JUN_moy = np.zeros([30],float)
-
-## ch 16 ##
-#bbzone_CH16_JUN = nonzero((lon16_JUN >= 120.23) & (lon16_JUN <= 126.23) & (lat16_JUN >= -78.06) & (lat16_JUN <= -72.06))
-#emis16_JUN_moy = np.zeros([30],float)
-#tb16_JUN_moy = np.zeros([30],float)
-#ts16_JUN_moy = np.zeros([30],float)
-
-for ijr in range (0,30):
-     print 'jour=', ijr+1
-     ## ch17 ##
-     ind_jr17 = np.where(jjr17_JUN[bbzone_CH17_JUN]==ijr+1)[0]
-     a = emis17_JUN[bbzone_CH17_JUN][ind_jr17]
-     b = tb17_JUN[bbzone_CH17_JUN][ind_jr17]
-     c = ts17_JUN[bbzone_CH17_JUN][ind_jr17]
-     emis17_JUN_moy[ijr] = mean(a[nonzero((a!=-500.)&(a<=1.))])
-     tb17_JUN_moy[ijr] = mean(b[nonzero((b!=-500.)&(b!=0.))])
-     ts17_JUN_moy[ijr] = mean(c[nonzero((c!=-500.)&(c!=0.))])
-     ## ch18 ##
-     ind_jr18 = np.where(jjr18_JUN[bbzone_CH18_JUN]==ijr+1)[0]
-     d = emis18_JUN[bbzone_CH18_JUN][ind_jr18]
-     e = tb18_JUN[bbzone_CH18_JUN][ind_jr18]
-     f = ts18_JUN[bbzone_CH18_JUN][ind_jr18]
-     emis18_JUN_moy[ijr] = mean(d[nonzero((d != -500.) & (d <= 1.))])
-     tb18_JUN_moy[ijr] = mean(e[nonzero((e != -500.) & (e != 0.))])
-     ts18_JUN_moy[ijr] = mean(f[nonzero((f != -500.) & (f != 0.))])
-     ## ch16 ##
-#     ind_jr16 = np.where(jjr16_JUN[bbzone_CH16_JUN]==ijr+1)[0]
-#     g = emis16_JUN[bbzone_CH16_JUN][ind_jr16]
-#     h = tb16_JUN[bbzone_CH16_JUN][ind_jr16]
-#     l = ts16_JUN[bbzone_CH16_JUN][ind_jr16]
-#     emis16_JUN_moy[ijr] = mean(g[nonzero((g != -500.) & (g <= 1.))])
-#     tb16_JUN_moy[ijr] = mean(h[nonzero((h != -500.) & (h != 0.))])
-#     ts16_JUN_moy[ijr] = mean(l[nonzero((l != -500.) & (l != 0.))])
-
-
-## ch17 - ch18 ##
-fig=plt.figure()
-plt.subplot(3,1,1)
-plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='r')
-plt.plot(arange(0,30,1),emis18_JUN_moy,label='91.66GHz-H',c='b')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('emissivity')
-legend(loc=7)
-plt.title('SSMIS - JUNE 2010')
-plt.subplot(3,1,2)
-plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='r')
-plt.plot(arange(0,30,1),tb18_JUN_moy,label='91.66GHz-H',c='b')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('brightness temperature')
-legend(loc=7)
-plt.subplot(3,1,3)
-plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='r')
-plt.plot(arange(0,30,1),ts18_JUN_moy,label='91.66GHz-H',c='b')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('surface temperature')
-legend(loc=7)
-fig.show()
-
-## ch16 ##
-fig=plt.figure()
-plt.subplot(3,1,1)
-plt.plot(arange(0,30,1),emis16_JUN_moy,label='37GHz-V',c='r')
-plt.plot(arange(0,30,1),emis17_JUN_moy,label='91.66GHz-V',c='g')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('emissivity')
-legend(loc=7)
-plt.title('SSMIS - JUNE 2010')
-plt.subplot(3,1,2)
-plt.plot(arange(0,30,1),tb16_JUN_moy,label='37GHz-V',c='r')
-plt.plot(arange(0,30,1),tb17_JUN_moy,label='91.66GHz-V',c='g')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('brightness temperature')
-legend(loc=7)
-plt.subplot(3,1,3)
-plt.plot(arange(0,30,1),ts16_JUN_moy,label='37GHz-V',c='r')
-plt.plot(arange(0,30,1),ts17_JUN_moy,label='91.66GHz-V',c='g')
-plt.xticks(arange(1,31,1))
-grid(True)
-ylabel('surface temperature')
-legend(loc=7)
-fig.show()
-
-
-
-tb17_JUN_anom = np.zeros([30],float)
-tb18_JUN_anom = np.zeros([30],float)
-for ijr in range (0,30):
-     print 'jour=', ijr + 1
-     tb17_JUN_anom[ijr]=tb17_JUN_moy[ijr]-tb17_JUN_moy.mean()
-     tb18_JUN_anom[ijr]=tb18_JUN_moy[ijr]-tb18_JUN_moy.mean()
-
-
-fig=plt.figure()
-plt.plot(arange(0,30,1),tb17_JUN_anom,label='91.66Ghz-V',c='r')
-plt.plot(arange(0,30,1),tb18_JUN_anom,label='91.66GHz-H',c='b')
-plt.plot(arange(0,31,1),np.zeros([31]),'--',c='k')
-ylabel('Tb anomaly')
-legend()
-twinx().plot(arange(0,30,1),ts17_JUN_moy,label='surface temperature',c='g')
-ylabel('surface temperature')
-plt.xticks(arange(0, 30, 1), arange(1, 31, 1))
-grid(True)
-plt.title('SSMIS - JUNE 2010')
-fig.show()
-
-
-
-
-################
-# CARTOGRAPHIE #
-################
-## Etude sur l'Antarctique ##
-dx=5.
-dy=5.
-x0, x1 = -180, 180
-y0, y1 = -90, -30
-
-## ch17 ##
-bbemis_ch17_JUN=nonzero((emis17_JUN!=-500.)&(emis17_JUN<1.)&(emis17_JUN>0.))
-bbtb_ch17_JUN=nonzero((tb17_JUN!=-500.)&(tb17_JUN!=0.))
-OUTZCH17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float)
-outzch17_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
-lonch17_JUN=np.zeros([len(np.arange(x0, x1+1, dx))], float)
-latch17_JUN=np.zeros([len(np.arange(y0, y1+1, dy))], float)
-
-## ch18 ##
-bbemis_ch18_JUN=nonzero((emis18_JUN!=-500.)&(emis18_JUN<1.)&(emis18_JUN>0.))
-bbtb_ch18_JUN=nonzero((tb18_JUN!=-500.)&(tb18_JUN!=0.))
-OUTZCH18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),30], float)
-outzch18_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float)
-lonch18_JUN=np.zeros([len(np.arange(x0, x1+1, dx))], float)
-latch18_JUN=np.zeros([len(np.arange(y0, y1+1, dy))], float)
-
-for ijr in range(0,30):
-    print 'jour=', ijr+1
-    ## ch17 ##
-    ind_jr17_JUN = np.where(jjr17_JUN[bbtb_ch17_JUN] == ijr+1)[0]
-    xx = lon17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
-    yy = lat17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
-    zz = tb17_JUN[bbtb_ch17_JUN][ind_jr17_JUN]
-    zz0 = min(zz)
-    zz1 = max(zz)
-    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
-    outzch17_JUN = outz
-    lonch17_JUN = outx
-    latch17_JUN = outy
-    OUTZCH17_JUN[:,:,ijr] = outzch17_JUN[:,:]
-    ## ch18 ##
-    ind_jr18_JUN = np.where(jjr18_JUN[bbtb_ch18_JUN] == ijr+1)[0]
-    xx = lon18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
-    yy = lat18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
-    zz = tb18_JUN[bbtb_ch18_JUN][ind_jr18_JUN]
-    zz0 = min(zz)
-    zz1 = max(zz)
-    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1)
-    outzch18_JUN = outz
-    lonch18_JUN = outx
-    latch18_JUN = outy
-    OUTZCH18_JUN[:,:,ijr] = outzch18_JUN[:,:]
-
-    
-## ch17 ##
-mean_outzch17_JUN = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float)
-for ilon in range (0,len(lonch17_JUN)):
-    for ilat in range (0,len(latch17_JUN)):
-        mean_outzch17_JUN[ilat,ilon] = OUTZCH17_JUN[ilat,ilon,:].mean()
-
-
-## ch18 ##
-mean_outzch18_JUN = np.zeros([len(latch18_JUN), len(lonch18_JUN)], float)
-for ilon in range (0,len(lonch18_JUN)):
-    for ilat in range (0,len(latch18_JUN)):
-        mean_outzch18_JUN[ilat,ilon] = OUTZCH18_JUN[ilat,ilon,:].mean()
-
-
-## ch17 ##
-tbch17_anom_JUN = np.zeros([len(latch17_JUN),len(lonch17_JUN),30], float)
-for ijr in range (0,30):
-    tbch17_anom_JUN[:,:,ijr] = OUTZCH17_JUN[:,:,ijr] - mean_outzch17_JUN[:,:]
-
-
-## ch18 ##
-tbch18_anom_JUN = np.zeros([len(latch18_JUN),len(lonch18_JUN),30], float)
-for ijr in range (0,30):
-    tbch18_anom_JUN[:,:,ijr] = OUTZCH18_JUN[:,:,ijr] - mean_outzch18_JUN[:,:]
-
-
-for ijr in range (23, 30):
-     figure()
-     plt.ion()
-     m = Basemap(llcrnrlon=-60, urcrnrlon=-40, llcrnrlat=-85, urcrnrlat=-75, projection='cyl', resolution='c', fix_aspect=True)
-     m.drawcoastlines(linewidth = 1)
-     m.drawparallels(np.arange(-85., 75., 2))
-     m.drawmeridians(np.arange(-60., -40., 2))
-     #m.fillcontinents()
-     clevs = arange(-25., 5., 0.1)
-     xii,yii = m(*np.meshgrid(lonch17_JUN, latch17_JUN))
-     cs = m.contourf(xii, yii, tbch17_anom_JUN[:,:,ijr], clevs, cmap=cm.s3pcpn_l_r)
-     cbar = colorbar(cs)
-     cbar.set_label('Tb anomaly SSMIS CH17 - JUNE')
-     xticks(np.arange(-60., -40., 2))
-     yticks(np.arange(-85., 75., 2))
-     plt.savefig('/usr/home/lahlod/twice_d/figures_output_ANTARC/SSMIS/mean_tb_anomaly_map_'+str(ijr+1)+'JUN_ch17_SSMIS_Zoom_zone2')
-
-
-figure()
-plt.ion()
-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., 90., 20))
-m.drawmeridians(np.arange(-180., 180., 20))
-#m.fillcontinents()
-xii,yii = m(*np.meshgrid(lonch17_JUN, latch17_JUN))
-
-## BIAIS ch17-ch18 ## 
-biais_JUN = mean_outzch17_JUN - mean_outzch18_JUN
-clevs = arange(0., 45., 1.)
-cs = m.contourf(xii, yii, biais_JUN, clevs, cmap=cm.s3pcpn_l_r)
-cbar = colorbar(cs)
-cbar.set_label('Bias [CH17-CH18] of Mean Tb JUNE - SSMIS')
-
-## VARIANCE ch17 - ch18 ##
-std1 = np.zeros([len(latch17_JUN), len(lonch17_JUN)], float)
-for ilat in range (0, len(latch17_JUN)):
-    for ilon in range (0, len(lonch17_JUN)):
-        std1[ilat, ilon] = (mean_outzch17_JUN[ilat, ilon]**2)-(mean_outzch18_JUN[ilat, ilon]**2)
-
-
-N = len(lonch17_JUN)*len(latch17_JUN)
-std_JUN = std1/N
-clevs = arange(0., 25., 0.1)
-cs = m.contourf(xii, yii, std_JUN, clevs, cmap=cm.s3pcpn_l_r)
-cbar = colorbar(cs)
-cbar.set_label('Stantard deviation [CH17-CH18] of Mean Tb JUNE - SSMIS')
-
-
-
-##########################
-# DIAGRAMME DE HOVMOLLER #
-##########################
-
-# shape(tbch17_anom_JUN) = [ilat, ilon, ijr]
-
-## tranche de latitude Ã©tudiÃ©e ##
-#bbtranche17_JUN = nonzero((latch17_JUN == -75.))
-bbtranche17_JUN = nonzero((latch17_JUN >= -85.) & (latch17_JUN <= -75))
-#bbtranche17_JUN = nonzero((latch17_JUN >= -90.) & (latch17_JUN <= -85))
-mean_tbch17_anom_JUN = np.zeros([len(lonch17_JUN), 30], float)
-for ilon in range (0, len(lonch17_JUN)):
-    for ijr in range (0,30):
-        mean_tbch17_anom_JUN[ilon,ijr] = tbch17_anom_JUN[bbtranche17_JUN][:,ilon,ijr].mean()
-
-
-y_time, x_space = m(*np.meshgrid(arange(0,30,1), lonch17_JUN))
-fig = plt.figure()
-plt.pcolor(x_space, y_time, mean_tbch17_anom_JUN, cmap=cm.s3pcpn_l_r, vmin = -30., vmax = 25.)
-plt.axis([-180., 180., 0, 29])
-cb = plt.colorbar()
-cb.set_label('Tb anomaly - SSMIS CH17')
-plt.xticks(arange(-180.,220.,40))
-plt.yticks(arange(0, 30, 1), arange(1,31,1))
-plt.xlabel('longitude')
-plt.ylabel('JUNE 2010')
-
+
+
+
+############### fichiers par mois pour deux canaux (polars H et V) ##################################
+
+########
+# ch17 #
+########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH17_ANTARC_'
+f3 = '2010.DAT'
+date=np.array(['FEBRUARY', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+numlines = np.zeros([len(date)],int)
+
+for imo in range (0, len(date)):
+     print date[imo] 
+     f = f1 + str(date[imo]) + f3
+     fichier = open(f, 'r')
+     numlines[imo] = 0
+     for line in fichier: numlines[imo] += 1
+
+      fichier.close()
+
+
+imo = 0 # FEBUARY
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch17_FEB=ssmis
+lon17_FEB=ssch17_FEB[0,:]
+lat17_FEB=ssch17_FEB[1,:]
+jjr17_FEB=ssch17_FEB[4,:]
+ts17_FEB=ssch17_FEB[8,:]
+emis17_FEB=ssch17_FEB[14,:]
+tb17_FEB=ssch17_FEB[13,:]
+tup17_FEB=ssch17_FEB[16,:]
+tdn17_FEB=ssch17_FEB[15,:]
+trans17_FEB=ssch17_FEB[17,:]
+orog17_FEB=ssch17_FEB[11,:]
+
+
+imo = 1 # APRIL
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch17_APR=ssmis
+lon17_APR=ssch17_APR[0,:]
+lat17_APR=ssch17_APR[1,:]
+jjr17_APR=ssch17_APR[4,:]
+ts17_APR=ssch17_APR[8,:]
+emis17_APR=ssch17_APR[14,:]
+tb17_APR=ssch17_APR[13,:]
+tup17_APR=ssch17_APR[16,:]
+tdn17_APR=ssch17_APR[15,:]
+trans17_APR=ssch17_APR[17,:]
+orog17_APR=ssch17_APR[11,:]
+
+
+imo = 2 # MAY
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch17_MAY=ssmis
+lon17_MAY=ssch17_MAY[0,:]
+lat17_MAY=ssch17_MAY[1,:]
+jjr17_MAY=ssch17_MAY[4,:]
+ts17_MAY=ssch17_MAY[8,:]
+emis17_MAY=ssch17_MAY[14,:]
+tb17_MAY=ssch17_MAY[13,:]
+tup17_MAY=ssch17_MAY[16,:]
+tdn17_MAY=ssch17_MAY[15,:]
+trans17_MAY=ssch17_MAY[17,:]
+orog17_MAY=ssch17_MAY[11,:]
+
+
+imo = 3 # JUNE
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch17_JUN=ssmis
+lon17_JUN=ssch17_JUN[0,:]
+lat17_JUN=ssch17_JUN[1,:]
+jjr17_JUN=ssch17_JUN[4,:]
+ts17_JUN=ssch17_JUN[8,:]
+emis17_JUN=ssch17_JUN[14,:]
+tb17_JUN=ssch17_JUN[13,:]
+tup17_JUN=ssch17_JUN[16,:]
+tdn17_JUN=ssch17_JUN[15,:]
+trans17_JUN=ssch17_JUN[17,:]
+orog17_JUN=ssch17_JUN[11,:]
+
+
+imo = 4 # JULY
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch17_JUL=ssmis
+lon17_JUL=ssch17_JUL[0,:]
+lat17_JUL=ssch17_JUL[1,:]
+jjr17_JUL=ssch17_JUL[4,:]
+ts17_JUL=ssch17_JUL[8,:]
+emis17_JUL=ssch17_JUL[14,:]
+tb17_JUL=ssch17_JUL[13,:]
+tup17_JUL=ssch17_JUL[16,:]
+tdn17_JUL=ssch17_JUL[15,:]
+trans17_JUL=ssch17_JUL[17,:]
+orog17_JUL=ssch17_JUL[11,:]
+
+
+########
+# ch18 #
+########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH18_ANTARC_'
+f3 = '2010.DAT'
+date=np.array(['FEBRUARY', 'APRIL', 'JULY'])
+numlines = np.zeros([len(date)],int)
+
+for imo in range (0, len(date)):
+     print date[imo] 
+     f = f1 + str(date[imo]) + f3
+     fichier = open(f, 'r')
+     numlines[imo] = 0
+     for line in fichier: numlines[imo] += 1
+
+      fichier.close()
+
+
+imo = 0 # FEBUARY
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch18_FEB=ssmis
+lon18_FEB=ssch18_FEB[0,:]
+lat18_FEB=ssch18_FEB[1,:]
+jjr18_FEB=ssch18_FEB[4,:]
+ts18_FEB=ssch18_FEB[8,:]
+emis18_FEB=ssch18_FEB[14,:]
+tb18_FEB=ssch18_FEB[13,:]
+tup18_FEB=ssch18_FEB[16,:]
+tdn18_FEB=ssch18_FEB[15,:]
+trans18_FEB=ssch18_FEB[17,:]
+orog18_FEB=ssch18_FEB[11,:]
+
+
+imo = 1 # APRIL
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch18_APR=ssmis
+lon18_APR=ssch18_APR[0,:]
+lat18_APR=ssch18_APR[1,:]
+jjr18_APR=ssch18_APR[4,:]
+ts18_APR=ssch18_APR[8,:]
+emis18_APR=ssch18_APR[14,:]
+tb18_APR=ssch18_APR[13,:]
+tup18_APR=ssch18_APR[16,:]
+tdn18_APR=ssch18_APR[15,:]
+trans18_APR=ssch18_APR[17,:]
+orog18_APR=ssch18_APR[11,:]
+
+
+
+imo = 2 # JULY
+fichier = open(f1 + str(date[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+    fichier.close
+
+ssch18_JUL=ssmis
+lon18_JUL=ssch18_JUL[0,:]
+lat18_JUL=ssch18_JUL[1,:]
+jjr18_JUL=ssch18_JUL[4,:]
+ts18_JUL=ssch18_JUL[8,:]
+emis18_JUL=ssch18_JUL[14,:]
+tb18_JUL=ssch18_JUL[13,:]
+tup18_JUL=ssch18_JUL[16,:]
+tdn18_JUL=ssch18_JUL[15,:]
+trans18_JUL=ssch18_JUL[17,:]
+orog18_JUL=ssch18_JUL[11,:]
+
+
+##########
+## ch12 ##
+##########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH12_ANTARC_'
+f3 = '2010.DAT'
+month = np.array(['FEBRUARY', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+numlines = np.zeros([len(month)],int)
+
+for imo in range (0, len(month)):
+     print month[imo] 
+     f = f1 + str(month[imo]) + f3
+     fichier = open(f, 'r')
+     numlines[imo] = 0
+     for line in fichier: numlines[imo] += 1
+
+      fichier.close()
+
+
+imo = 0 # FEB 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+
+ssch12_FEB=ssmis
+lon12_FEB=ssch12_FEB[0,:]
+lat12_FEB=ssch12_FEB[1,:]
+jjr12_FEB=ssch12_FEB[4,:]
+ts12_FEB=ssch12_FEB[8,:]
+emis12_FEB=ssch12_FEB[14,:]
+tb12_FEB=ssch12_FEB[13,:]
+tup12_FEB=ssch12_FEB[16,:]
+tdn12_FEB=ssch12_FEB[15,:]
+trans12_FEB=ssch12_FEB[17,:]
+orog12_FEB=ssch12_FEB[11,:]
+
+imo = 1 # APR 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+ssch12_APR=ssmis
+lon12_APR=ssch12_APR[0,:]
+lat12_APR=ssch12_APR[1,:]
+jjr12_APR=ssch12_APR[4,:]
+ts12_APR=ssch12_APR[8,:]
+emis12_APR=ssch12_APR[14,:]
+tb12_APR=ssch12_APR[13,:]
+tup12_APR=ssch12_APR[16,:]
+tdn12_APR=ssch12_APR[15,:]
+trans12_APR=ssch12_APR[17,:]
+orog12_APR=ssch12_APR[11,:]
+
+
+imo = 4 # JUL 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+ssch12_JUL=ssmis
+lon12_JUL=ssch12_JUL[0,:]
+lat12_JUL=ssch12_JUL[1,:]
+jjr12_JUL=ssch12_JUL[4,:]
+ts12_JUL=ssch12_JUL[8,:]
+emis12_JUL=ssch12_JUL[14,:]
+tb12_JUL=ssch12_JUL[13,:]
+tup12_JUL=ssch12_JUL[16,:]
+tdn12_JUL=ssch12_JUL[15,:]
+trans12_JUL=ssch12_JUL[17,:]
+orog12_JUL=ssch12_JUL[11,:]
+
+
+##########
+## ch13 ##
+##########
+
+f1 = '/net/dedale/usr/dedale/surf/lelod/ANTARC/SSMIS_CH13_ANTARC_'
+f3 = '2010.DAT'
+month = np.array(['FEBRUARY', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+numlines = np.zeros([len(month)],int)
+
+for imo in range (0, len(month)):
+     print month[imo] 
+     f = f1 + str(month[imo]) + f3
+     fichier = open(f, 'r')
+     numlines[imo] = 0
+     for line in fichier: numlines[imo] += 1
+
+      fichier.close()
+
+
+imo = 0 # FEB 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+
+ssch13_FEB=ssmis
+lon13_FEB=ssch13_FEB[0,:]
+lat13_FEB=ssch13_FEB[1,:]
+jjr13_FEB=ssch13_FEB[4,:]
+ts13_FEB=ssch13_FEB[8,:]
+emis13_FEB=ssch13_FEB[14,:]
+tb13_FEB=ssch13_FEB[13,:]
+tup13_FEB=ssch13_FEB[16,:]
+tdn13_FEB=ssch13_FEB[15,:]
+trans13_FEB=ssch13_FEB[17,:]
+orog13_FEB=ssch13_FEB[11,:]
+
+imo = 1 # APR 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+ssch13_APR=ssmis
+lon13_APR=ssch13_APR[0,:]
+lat13_APR=ssch13_APR[1,:]
+jjr13_APR=ssch13_APR[4,:]
+ts13_APR=ssch13_APR[8,:]
+emis13_APR=ssch13_APR[14,:]
+tb13_APR=ssch13_APR[13,:]
+tup13_APR=ssch13_APR[16,:]
+tdn13_APR=ssch13_APR[15,:]
+trans13_APR=ssch13_APR[17,:]
+orog13_APR=ssch13_APR[11,:]
+
+
+imo = 4 # JUL 
+fichier = open(f1 + str(month[imo]) + f3, 'r')
+ssmis = np.zeros([18, numlines[imo]], float)
+for iligne in range (0,numlines[imo]):
+    line = fichier.readline()
+    liste = line.split()
+    for j in range(0,18):
+        ssmis[j,iligne] = float(liste[j])
+
+
+    fichier.close
+
+ssch13_JUL=ssmis
+lon13_JUL=ssch13_JUL[0,:]
+lat13_JUL=ssch13_JUL[1,:]
+jjr13_JUL=ssch13_JUL[4,:]
+ts13_JUL=ssch13_JUL[8,:]
+emis13_JUL=ssch13_JUL[14,:]
+tb13_JUL=ssch13_JUL[13,:]
+tup13_JUL=ssch13_JUL[16,:]
+tdn13_JUL=ssch13_JUL[15,:]
+trans13_JUL=ssch13_JUL[17,:]
+orog13_JUL=ssch13_JUL[11,:]
Index: /trunk/src/scripts_Laura/read_emis_glace.py
===================================================================
--- /trunk/src/scripts_Laura/read_emis_glace.py	(revision 30)
+++ /trunk/src/scripts_Laura/read_emis_glace.py	(revision 30)
@@ -0,0 +1,114 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import string
+import numpy as np
+import matplotlib.pyplot as plt
+import ffgrid2
+from pylab import *
+from mpl_toolkits.basemap import Basemap
+from mpl_toolkits.basemap import shiftgrid, cm
+import draw_map
+import carte 
+
+#le_mois='NOVEMBER2009'
+
+fichier=open("/net/argos/data/parvati/lahlod/ARCTIC/AMSUA_EMIS_GLACE_DECEMBER2009.DAT",'r')
+numlines = 0
+for line in fichier: numlines += 1
+
+fichier.close
+
+
+fichier=open("/net/argos/data/parvati/lahlod/ARCTIC/AMSUA_EMIS_GLACE_DECEMBER2009.DAT",'r')
+
+nbtotal=numlines-1
+
+iligne=0
+lat=np.zeros([nbtotal],float)
+lon=np.zeros([nbtotal],float)
+jjr=np.zeros([nbtotal],float)
+zen=np.zeros([nbtotal],float)
+fov=np.zeros([nbtotal],float)
+ts=np.zeros([nbtotal],float)
+emis=np.zeros([4,nbtotal],float)
+tb=np.zeros([4,nbtotal],float)
+tup=np.zeros([4,nbtotal],float)
+tdn=np.zeros([4,nbtotal],float)
+#trans=np.zeros([4,nbtotal],float)
+
+
+
+while (iligne < nbtotal) :
+         line=fichier.readline()
+         # exemple : line = "0.22 2.3 5.0 6"
+         liste = line.split()
+         # exemple : listeCoord ['0.22', '2.3', '5.0', '6'] (liste de chaine de caract?es)
+         lat[iligne] = float(liste[1])
+         lon[iligne] = float(liste[0])
+         jjr[iligne] = float(liste[4])
+         ts[iligne] = float(liste[8])
+         fov[iligne] = float(liste[10])
+         #trans[iligne] = float(liste[17])
+         for ki in range(0,4):
+             emis[ki,iligne] = float(liste[12+ki])
+             tb[ki,iligne] = float(liste[16+ki])
+             tdn[ki,iligne] = float(liste[20+ki])
+             tup[ki,iligne] = float(liste[24+ki])
+             #trans[ki,iligne] = float(liste[28+ki])
+            # tup_ssmis[ki,iligne] = float(liste[28+ki])
+            # tdn_ssmis[ki,iligne] = float(liste[37+ki])
+             #trans_ssmis[ki,iligne] = float(liste[44+ki])
+         iligne=iligne+1
+         
+
+fichier.close
+
+for canal in range(0,4):
+    for ii in range (0,size(emis[canal,:])):
+        if (emis[canal,ii] > 1): emis[canal,ii]=0.9999
+  
+
+bblat = nonzero(lat >= 65.)  
+bbjr = nonzero(jjr[bblat] == 1.)
+
+lon_zon = lon[bblat][bbjr]
+lat_zon = lat[bblat][bbjr]
+emis_zon = emis[3,:][bblat][bbjr]
+
+
+dx=1
+dy=1
+x0, x1 = -180, 180
+y0, y1 = 65, 90
+
+emis_mesh=np.zeros([len(arange(y0,y1+dy,dy)),len(arange(x0,x1+dx,dx))],float)
+lon_mesh=np.zeros([len(arange(x0,x1+dx,dx))])
+lat_mesh=np.zeros([len(arange(y0,y1+dy,dy))])
+xx = lon[bblat][bbjr]
+yy = lat[bblat][bbjr]
+zz = emis[0,:][bblat][bbjr]
+zz0 = min(zz)
+zz1 = max(zz)
+outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0,x1,y0,y1,zz0, zz1)
+emis_mesh = outz
+lon_mesh = outx
+lat_mesh = outy
+
+plt.ion()
+figure()
+#m = Basemap(llcrnrlon=-180,urcrnrlon=180,llcrnrlat=65,urcrnrlat=90,projection='cyl',resolution='c',fix_aspect=True)
+m = Basemap(projection = 'npaeqd',boundinglat = 60, lon_0 = 0, resolution = 'l')
+xii, yii = m(*np.meshgrid(lon_mesh,lat_mesh))
+#clevs=arange(-2400, -800, 10)
+m.drawcoastlines(linewidth=1)
+m.drawparallels(np.arange(60, 90, 20))
+m.drawmeridians(np.arange(-180, 180, 20))
+cs=m.contourf(xii,yii,y, cmap=cm.s3pcpn_l_r) # emissivity
+cbar =colorbar(cs)
+#cbar.set_label(txt)
+
+figure()
+carte.draw(emis[3,:][bblat][bbjr],lon[bblat][bbjr],lat[bblat][bbjr],'mean_ee89_amsua_fev2010.png','Emissivity near 89 GHz',0.4,1.0,0.005,cm.s3pcpn)
+
+
+
Index: /trunk/src/scripts_Laura/read_netcdf_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/read_netcdf_AMSUA_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/read_netcdf_AMSUA_test.py	(revision 30)
@@ -0,0 +1,112 @@
+#!/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
+
+
+#####################
+## read daily data ##
+#####################
+month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+len_month = np.array([31, 28, 31, 30, 31, 30, 31])
+
+## JANUARY ##
+imo = 0
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_JAN = ncfile.variables['day'][:]
+emis_JAN = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## FEBRUARY ##
+imo = 1
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_FEB = ncfile.variables['day'][:]
+emis_FEB = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## MARCH ##
+imo = 2
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_MAR = ncfile.variables['day'][:]
+emis_MAR = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## APRIL ##
+imo = 3
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_APR = ncfile.variables['day'][:]
+emis_APR = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## MAY ##
+imo = 4
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_MAY = ncfile.variables['day'][:]
+emis_MAY = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## JUNE ##
+imo = 5
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_JUN = ncfile.variables['day'][:]
+emis_JUN = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+## JULY ##
+imo = 6
+ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] + '_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+jrs_JUL = ncfile.variables['day'][:]
+emis_JUL = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+
+
+
+
+#######################
+## read monthly data ##
+#######################
+
+ncfile = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_JAN-MAR-MAY-JUN_ANTARC.nc', 'r', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+mon = ncfile.variables['month'][:]
+emis_moy1 = ncfile.variables['emissivity'][:]
+ncfile.close()
+
+
+ncfile = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4')
+lon = ncfile.variables['longitude'][:]
+lat = ncfile.variables['latitude'][:]
+chan = ncfile.variables['channels'][:]
+mon = ncfile.variables['month'][:]
+emis_moy2 = ncfile.variables['emissivity'][:]
+ncfile.close()
+
Index: /trunk/src/scripts_Laura/write_netcdf_AMSUA_test.py
===================================================================
--- /trunk/src/scripts_Laura/write_netcdf_AMSUA_test.py	(revision 30)
+++ /trunk/src/scripts_Laura/write_netcdf_AMSUA_test.py	(revision 30)
@@ -0,0 +1,194 @@
+#!/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
+
+
+############################
+## monthly mean emisivity ##
+############################
+month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+#rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_JAN-MAR-MAY-JUN_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', 2)
+rootgrp.createDimension('month', 4)
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncmon = rootgrp.createVariable('month', 'f8', ('month',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('month', 'channels', 'latitude', 'longitude'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncmon[:] = [1., 2., 3., 4.]
+ncemis[:] = mean_outz2
+
+rootgrp.close()
+
+
+
+#####################
+## daily emisivity ##
+#####################
+month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY'])
+len_month = np.array([31, 28, 31, 30, 31, 30, 31])
+chan = array(['CH1', 'CH2'])
+lon = lonch1_JAN 
+lat = latch1_JAN 
+
+## JANUARY ##
+imo = 0
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_JAN
+
+rootgrp.close()
+
+
+## FEBRUARY ##
+imo = 1
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_FEB
+
+rootgrp.close()
+
+
+## MARCH ##
+imo = 2
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_MAR
+
+rootgrp.close()
+
+
+## APRIL ##
+imo = 3
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_APR
+
+rootgrp.close()
+
+
+## MAY ##
+imo = 4
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_MAY
+
+rootgrp.close()
+
+
+## JUNE ##
+imo = 5
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_JUN
+
+rootgrp.close()
+
+
+## JUlY##
+imo = 6
+rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4')
+rootgrp.createDimension('longitude', len(lon))
+rootgrp.createDimension('latitude', len(lat))
+rootgrp.createDimension('channels', len(chan))
+rootgrp.createDimension('day', len_month[imo])
+nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',))
+nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',))
+ncchan = rootgrp.createVariable('channels', 'f8', ('channels',))
+ncjours = rootgrp.createVariable('day', 'f8', ('day',))
+ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day'))
+nclon[:] =lon
+nclat[:] = lat
+ncchan[:] = [23.8, 89]
+ncjours[:] = np.arange(0, len_month[imo], 1)
+ncemis[:] = OUTZ_JUL
+
+rootgrp.close()
+
+
+
+
