Changeset 25


Ignore:
Timestamp:
06/04/14 18:41:28 (10 years ago)
Author:
lahlod
Message:

new scripts

Location:
trunk/src/scripts_Laura
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scripts_Laura/diff_frequ_AMSUA_test.py

    r24 r25  
    2424 
    2525 
    26 ## FABRUARY ## 
     26## JANUARY ## 
     27imo = 0 
     28## ch1 ## 
     29fovZen_ch1_JAN = np.where(fov1_JAN == 15.) 
     30bbemis_ch1_JAN = nonzero((emis1_JAN[fovZen_ch1_JAN] != -500.) & (emis1_JAN[fovZen_ch1_JAN] <= 1.)) 
     31OUTZCH1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     32outzch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     33lonch1_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     34latch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     35## ch15 ## 
     36fovZen_ch15_JAN = np.where(fov15_JAN == 15.) 
     37bbemis_ch15_JAN = nonzero((emis15_JAN[fovZen_ch15_JAN] != -500.) & (emis15_JAN[fovZen_ch15_JAN] <= 1.)) 
     38OUTZCH15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     39outzch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     40lonch15_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     41latch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     42for ijr in range (0, len_month[imo]): 
     43    print 'jour=', ijr+1 
     44    ## ch1 ## 
     45    ind_jr1_JAN = np.where(jjr1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN] == ijr+1)[0] 
     46    xx = lon1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] 
     47    yy = lat1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] 
     48    zz = emis1_JAN[fovZen_ch1_JAN][bbemis_ch1_JAN][ind_jr1_JAN] 
     49    zz0 = min(zz) 
     50    zz1 = max(zz) 
     51    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     52    outzch1_JAN = outz 
     53    lonch1_JAN = outx 
     54    latch1_JAN = outy 
     55    OUTZCH1_JAN[:,:,ijr] = outzch1_JAN[:,:] 
     56    ## ch15 ## 
     57    ind_jr15_JAN = np.where(jjr15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN] == ijr+1)[0] 
     58    xx = lon15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] 
     59    yy = lat15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] 
     60    zz = emis15_JAN[fovZen_ch15_JAN][bbemis_ch15_JAN][ind_jr15_JAN] 
     61    zz0 = min(zz) 
     62    zz1 = max(zz) 
     63    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     64    outzch15_JAN = outz 
     65    lonch15_JAN = outx 
     66    latch15_JAN = outy 
     67    OUTZCH15_JAN[:,:,ijr] = outzch15_JAN[:,:] 
     68 
     69OUTZ_JAN = np.array([OUTZCH1_JAN, OUTZCH15_JAN]) 
     70 
     71 
     72## FEBRUARY ## 
    2773imo = 1 
    2874## ch1 ## 
     
    71117OUTZ_FEB = np.array([OUTZCH1_FEB, OUTZCH15_FEB]) 
    72118 
     119## MARCH ## 
     120imo = 2 
     121## ch1 ## 
     122fovZen_ch1_MAR = np.where(fov1_MAR == 15.) 
     123bbemis_ch1_MAR = nonzero((emis1_MAR[fovZen_ch1_MAR] != -500.) & (emis1_MAR[fovZen_ch1_MAR] <= 1.)) 
     124OUTZCH1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     125outzch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     126lonch1_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     127latch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     128## ch15 ## 
     129fovZen_ch15_MAR = np.where(fov15_MAR == 15.) 
     130bbemis_ch15_MAR = nonzero((emis15_MAR[fovZen_ch15_MAR] != -500.) & (emis15_MAR[fovZen_ch15_MAR] <= 1.)) 
     131OUTZCH15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     132outzch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     133lonch15_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     134latch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     135for ijr in range (0, len_month[imo]): 
     136    print 'jour=', ijr+1 
     137    ## ch1 ## 
     138    ind_jr1_MAR = np.where(jjr1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR] == ijr+1)[0] 
     139    xx = lon1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] 
     140    yy = lat1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] 
     141    zz = emis1_MAR[fovZen_ch1_MAR][bbemis_ch1_MAR][ind_jr1_MAR] 
     142    zz0 = min(zz) 
     143    zz1 = max(zz) 
     144    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     145    outzch1_MAR = outz 
     146    lonch1_MAR = outx 
     147    latch1_MAR = outy 
     148    OUTZCH1_MAR[:,:,ijr] = outzch1_MAR[:,:] 
     149    ## ch15 ## 
     150    ind_jr15_MAR = np.where(jjr15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR] == ijr+1)[0] 
     151    xx = lon15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] 
     152    yy = lat15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] 
     153    zz = emis15_MAR[fovZen_ch15_MAR][bbemis_ch15_MAR][ind_jr15_MAR] 
     154    zz0 = min(zz) 
     155    zz1 = max(zz) 
     156    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     157    outzch15_MAR = outz 
     158    lonch15_MAR = outx 
     159    latch15_MAR = outy 
     160    OUTZCH15_MAR[:,:,ijr] = outzch15_MAR[:,:] 
     161 
     162OUTZ_MAR = np.array([OUTZCH1_MAR, OUTZCH15_MAR]) 
     163 
     164 
    73165## APRIL ## 
    74166imo = 3 
     
    117209OUTZ_APR = np.array([OUTZCH1_APR, OUTZCH15_APR]) 
    118210 
     211## MAY ## 
     212imo = 4 
     213## ch1 ## 
     214fovZen_ch1_MAY = np.where(fov1_MAY == 15.) 
     215bbemis_ch1_MAY = nonzero((emis1_MAY[fovZen_ch1_MAY] != -500.) & (emis1_MAY[fovZen_ch1_MAY] <= 1.)) 
     216OUTZCH1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     217outzch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     218lonch1_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     219latch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     220## ch15 ## 
     221fovZen_ch15_MAY = np.where(fov15_MAY == 15.) 
     222bbemis_ch15_MAY = nonzero((emis15_MAY[fovZen_ch15_MAY] != -500.) & (emis15_MAY[fovZen_ch15_MAY] <= 1.)) 
     223OUTZCH15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     224outzch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     225lonch15_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     226latch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     227for ijr in range (0, len_month[imo]): 
     228    print 'jour=', ijr+1 
     229    ## ch1 ## 
     230    ind_jr1_MAY = np.where(jjr1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY] == ijr+1)[0] 
     231    xx = lon1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] 
     232    yy = lat1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] 
     233    zz = emis1_MAY[fovZen_ch1_MAY][bbemis_ch1_MAY][ind_jr1_MAY] 
     234    zz0 = min(zz) 
     235    zz1 = max(zz) 
     236    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     237    outzch1_MAY = outz 
     238    lonch1_MAY = outx 
     239    latch1_MAY = outy 
     240    OUTZCH1_MAY[:,:,ijr] = outzch1_MAY[:,:] 
     241    ## ch15 ## 
     242    ind_jr15_MAY = np.where(jjr15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY] == ijr+1)[0] 
     243    xx = lon15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] 
     244    yy = lat15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] 
     245    zz = emis15_MAY[fovZen_ch15_MAY][bbemis_ch15_MAY][ind_jr15_MAY] 
     246    zz0 = min(zz) 
     247    zz1 = max(zz) 
     248    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     249    outzch15_MAY = outz 
     250    lonch15_MAY = outx 
     251    latch15_MAY = outy 
     252    OUTZCH15_MAY[:,:,ijr] = outzch15_MAY[:,:] 
     253 
     254OUTZ_MAY = np.array([OUTZCH1_MAY, OUTZCH15_MAY]) 
     255 
     256 
     257## JUNE ## 
     258imo = 5 
     259## ch1 ## 
     260fovZen_ch1_JUN = np.where(fov1_JUN == 15.) 
     261bbemis_ch1_JUN = nonzero((emis1_JUN[fovZen_ch1_JUN] != -500.) & (emis1_JUN[fovZen_ch1_JUN] <= 1.)) 
     262OUTZCH1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     263outzch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     264lonch1_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     265latch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     266## ch15 ## 
     267fovZen_ch15_JUN = np.where(fov15_JUN == 15.) 
     268bbemis_ch15_JUN = nonzero((emis15_JUN[fovZen_ch15_JUN] != -500.) & (emis15_JUN[fovZen_ch15_JUN] <= 1.)) 
     269OUTZCH15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 
     270outzch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 
     271lonch15_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 
     272latch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 
     273for ijr in range (0, len_month[imo]): 
     274    print 'jour=', ijr+1 
     275    ## ch1 ## 
     276    ind_jr1_JUN = np.where(jjr1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN] == ijr+1)[0] 
     277    xx = lon1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] 
     278    yy = lat1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] 
     279    zz = emis1_JUN[fovZen_ch1_JUN][bbemis_ch1_JUN][ind_jr1_JUN] 
     280    zz0 = min(zz) 
     281    zz1 = max(zz) 
     282    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     283    outzch1_JUN = outz 
     284    lonch1_JUN = outx 
     285    latch1_JUN = outy 
     286    OUTZCH1_JUN[:,:,ijr] = outzch1_JUN[:,:] 
     287    ## ch15 ## 
     288    ind_jr15_JUN = np.where(jjr15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN] == ijr+1)[0] 
     289    xx = lon15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] 
     290    yy = lat15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] 
     291    zz = emis15_JUN[fovZen_ch15_JUN][bbemis_ch15_JUN][ind_jr15_JUN] 
     292    zz0 = min(zz) 
     293    zz1 = max(zz) 
     294    outz, outx, outy = ffgrid2.ffgrid(xx, yy, zz, dx, dy, x0, x1, y0, y1, zz0, zz1) 
     295    outzch15_JUN = outz 
     296    lonch15_JUN = outx 
     297    latch15_JUN = outy 
     298    OUTZCH15_JUN[:,:,ijr] = outzch15_JUN[:,:] 
     299 
     300OUTZ_JUN = np.array([OUTZCH1_JUN, OUTZCH15_JUN]) 
     301 
    119302 
    120303## JULY ## 
     
    167350## calcul de la climatologie moyenne par mois ## 
    168351################################################ 
    169 lon = lonch1_FEB = lonch15_FEB = lonch1_APR = lonch15_APR 
    170 lat = latch1_FEB = latch15_FEB = latch1_APR = latch15_APR 
     352lon = lonch1_FEB  
     353lat = latch1_FEB  
     354## JANUARY ## 
     355mean_outz_JAN = np.zeros([len(chan), len(lat), len(lon)], float) 
     356for ich in range (0, len(chan)): 
     357    for ilon in range (0, len(lon)): 
     358        for ilat in range (0, len(lat)): 
     359            mean_outz_JAN[ich, ilat, ilon] = mean(OUTZ_JAN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JAN[ich, ilat, ilon, :]) == False)]) 
     360 
    171361## FEBRUARY ## 
    172362mean_outz_FEB = np.zeros([len(chan), len(lat), len(lon)], float) 
     
    176366            mean_outz_FEB[ich, ilat, ilon] = mean(OUTZ_FEB[ich, ilat, ilon, :][nonzero(isnan(OUTZ_FEB[ich, ilat, ilon, :]) == False)]) 
    177367 
     368## MARCH ## 
     369mean_outz_MAR = np.zeros([len(chan), len(lat), len(lon)], float) 
     370for ich in range (0, len(chan)): 
     371    for ilon in range (0, len(lon)): 
     372        for ilat in range (0, len(lat)): 
     373            mean_outz_MAR[ich, ilat, ilon] = mean(OUTZ_MAR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAR[ich, ilat, ilon, :]) == False)]) 
     374 
    178375## APRIL ## 
    179376mean_outz_APR = np.zeros([len(chan), len(lat), len(lon)], float) 
     
    183380            mean_outz_APR[ich, ilat, ilon] = mean(OUTZ_APR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_APR[ich, ilat, ilon, :]) == False)]) 
    184381 
     382## MAY ## 
     383mean_outz_MAY = np.zeros([len(chan), len(lat), len(lon)], float) 
     384for ich in range (0, len(chan)): 
     385    for ilon in range (0, len(lon)): 
     386        for ilat in range (0, len(lat)): 
     387            mean_outz_MAY[ich, ilat, ilon] = mean(OUTZ_MAY[ich, ilat, ilon, :][nonzero(isnan(OUTZ_MAY[ich, ilat, ilon, :]) == False)]) 
     388 
     389## JUN ## 
     390mean_outz_JUN = np.zeros([len(chan), len(lat), len(lon)], float) 
     391for ich in range (0, len(chan)): 
     392    for ilon in range (0, len(lon)): 
     393        for ilat in range (0, len(lat)): 
     394            mean_outz_JUN[ich, ilat, ilon] = mean(OUTZ_JUN[ich, ilat, ilon, :][nonzero(isnan(OUTZ_JUN[ich, ilat, ilon, :]) == False)]) 
     395 
    185396## JULY ## 
    186397mean_outz_JUL = np.zeros([len(chan), len(lat), len(lon)], float) 
     
    191402 
    192403 
    193 mean_outz = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL]) 
    194  
    195 month_red = np.array(['FABRUARY', 'APRIL', 'JULY']) 
    196 for imo in range (0, 3): 
     404mean_outz1 = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL]) 
     405mean_outz2 = np.array([mean_outz_JAN, mean_outz_MAR, mean_outz_MAY, mean_outz_JUN]) 
     406 
     407 
     408 
     409month_red = np.array(['JANUARY', 'MARCH', 'MAY', 'JUNE']) 
     410for imo in range (0, 4): 
    197411    plt.figure() 
    198412    plt.ion() 
     
    205419        xii,yii = m(*np.meshgrid(lon, lat)) 
    206420        clevs = (arange(0.4, 1., 0.001)) 
    207         cs = m.contourf(xii, yii, mean_outz[imo, ich, :, :], clevs, cmap=cm.s3pcpn_l_r) 
     421        cs = m.contourf(xii, yii, mean_outz2[imo, ich, :, :], clevs, cmap=cm.s3pcpn_l_r) 
    208422        cbar = colorbar(cs) 
    209423        cbar.set_label(chan[ich]+' - 23.8GHz - ' + month_red[imo] + ' - AMSUA') 
     
    260474xii,yii = m(*np.meshgrid(lon, lat)) 
    261475#clevs = (arange(0., 0.006, 0.00001)) 
    262 cs = m.contourf(xii, yii, var_JUL[0, :, :], cmap=cm.s3pcpn_l_r) 
     476cs = m.contourf(xii, yii, monthly_emis_JUL[0, :, :], cmap=cm.s3pcpn_l_r) 
    263477cbar = colorbar(cs) 
    264478cbar.set_label('CH1 - 23.8GHz') 
  • trunk/src/scripts_Laura/write_netcdf_AMSUA_test.py

    r24 r25  
    1414############################ 
    1515month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) 
    16 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4') 
     16#rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4') 
     17rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_JAN-MAR-MAY-JUN_ANTARC.nc', 'w', format = 'NETCDF4') 
    1718rootgrp.createDimension('longitude', len(lon)) 
    1819rootgrp.createDimension('latitude', len(lat)) 
    1920rootgrp.createDimension('channels', 2) 
    20 rootgrp.createDimension('month', 3) 
     21rootgrp.createDimension('month', 4) 
    2122nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
    2223nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     
    2728nclat[:] = lat 
    2829ncchan[:] = [23.8, 89] 
    29 ncmon[:] = [1., 2., 3.] 
    30 ncemis[:] = mean_outz 
     30ncmon[:] = [1., 2., 3., 4.] 
     31ncemis[:] = mean_outz2 
    3132 
    3233rootgrp.close() 
     
    3738## daily emisivity ## 
    3839##################### 
    39 month_red = array(['FEBRUARY', 'APRIL', 'JULY']) 
    40 len_month_red = np.array([28, 30, 31]) 
     40month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) 
     41len_month = np.array([31, 28, 31, 30, 31, 30, 31]) 
     42chan = array(['CH1', 'CH2']) 
     43lon = lonch1_JAN  
     44lat = latch1_JAN  
     45 
     46## JANUARY ## 
    4147imo = 0 
    42 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month_red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     48rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
    4349rootgrp.createDimension('longitude', len(lon)) 
    4450rootgrp.createDimension('latitude', len(lat)) 
    4551rootgrp.createDimension('channels', len(chan)) 
    46 rootgrp.createDimension('day', len_month_red[imo]) 
     52rootgrp.createDimension('day', len_month[imo]) 
    4753nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
    4854nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     
    5359nclat[:] = lat 
    5460ncchan[:] = [23.8, 89] 
    55 ncjours[:] = np.arange(0, len_month_red[imo], 1) 
    56 ncemis[:] = OUTZ_FEB 
     61ncjours[:] = np.arange(0, len_month[imo], 1) 
     62ncemis[:] = OUTZ_JAN 
    5763 
    5864rootgrp.close() 
    5965 
     66 
     67## FEBRUARY ## 
    6068imo = 1 
    61 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month_red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     69rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
    6270rootgrp.createDimension('longitude', len(lon)) 
    6371rootgrp.createDimension('latitude', len(lat)) 
    6472rootgrp.createDimension('channels', len(chan)) 
    65 rootgrp.createDimension('day', len_month_red[imo]) 
     73rootgrp.createDimension('day', len_month[imo]) 
    6674nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
    6775nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     
    7280nclat[:] = lat 
    7381ncchan[:] = [23.8, 89] 
    74 ncjours[:] = np.arange(0, len_month_red[imo], 1) 
    75 ncemis[:] = OUTZ_APR 
     82ncjours[:] = np.arange(0, len_month[imo], 1) 
     83ncemis[:] = OUTZ_FEB 
    7684 
    7785rootgrp.close() 
    7886 
     87 
     88## MARCH ## 
    7989imo = 2 
    80 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month_red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     90rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
    8191rootgrp.createDimension('longitude', len(lon)) 
    8292rootgrp.createDimension('latitude', len(lat)) 
    8393rootgrp.createDimension('channels', len(chan)) 
    84 rootgrp.createDimension('day', len_month_red[imo]) 
     94rootgrp.createDimension('day', len_month[imo]) 
    8595nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
    8696nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     
    91101nclat[:] = lat 
    92102ncchan[:] = [23.8, 89] 
    93 ncjours[:] = np.arange(0, len_month_red[imo], 1) 
     103ncjours[:] = np.arange(0, len_month[imo], 1) 
     104ncemis[:] = OUTZ_MAR 
     105 
     106rootgrp.close() 
     107 
     108 
     109## APRIL ## 
     110imo = 3 
     111rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     112rootgrp.createDimension('longitude', len(lon)) 
     113rootgrp.createDimension('latitude', len(lat)) 
     114rootgrp.createDimension('channels', len(chan)) 
     115rootgrp.createDimension('day', len_month[imo]) 
     116nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
     117nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     118ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 
     119ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 
     120ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 
     121nclon[:] =lon 
     122nclat[:] = lat 
     123ncchan[:] = [23.8, 89] 
     124ncjours[:] = np.arange(0, len_month[imo], 1) 
     125ncemis[:] = OUTZ_APR 
     126 
     127rootgrp.close() 
     128 
     129 
     130## MAY ## 
     131imo = 4 
     132rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     133rootgrp.createDimension('longitude', len(lon)) 
     134rootgrp.createDimension('latitude', len(lat)) 
     135rootgrp.createDimension('channels', len(chan)) 
     136rootgrp.createDimension('day', len_month[imo]) 
     137nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
     138nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     139ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 
     140ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 
     141ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 
     142nclon[:] =lon 
     143nclat[:] = lat 
     144ncchan[:] = [23.8, 89] 
     145ncjours[:] = np.arange(0, len_month[imo], 1) 
     146ncemis[:] = OUTZ_MAY 
     147 
     148rootgrp.close() 
     149 
     150 
     151## JUNE ## 
     152imo = 5 
     153rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     154rootgrp.createDimension('longitude', len(lon)) 
     155rootgrp.createDimension('latitude', len(lat)) 
     156rootgrp.createDimension('channels', len(chan)) 
     157rootgrp.createDimension('day', len_month[imo]) 
     158nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
     159nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     160ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 
     161ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 
     162ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 
     163nclon[:] =lon 
     164nclat[:] = lat 
     165ncchan[:] = [23.8, 89] 
     166ncjours[:] = np.arange(0, len_month[imo], 1) 
     167ncemis[:] = OUTZ_JUN 
     168 
     169rootgrp.close() 
     170 
     171 
     172## JUlY## 
     173imo = 6 
     174rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 
     175rootgrp.createDimension('longitude', len(lon)) 
     176rootgrp.createDimension('latitude', len(lat)) 
     177rootgrp.createDimension('channels', len(chan)) 
     178rootgrp.createDimension('day', len_month[imo]) 
     179nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 
     180nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 
     181ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 
     182ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 
     183ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 
     184nclon[:] =lon 
     185nclat[:] = lat 
     186ncchan[:] = [23.8, 89] 
     187ncjours[:] = np.arange(0, len_month[imo], 1) 
    94188ncemis[:] = OUTZ_JUL 
    95189 
     
    101195 
    102196 
    103 ### read nc file 
    104 #ncfile = Dataset('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4', 'r') 
    105 #data = ncfile.variables['data'][:] 
     197 
Note: See TracChangeset for help on using the changeset viewer.