Changeset 25
- Timestamp:
- 06/04/14 18:41:28 (10 years ago)
- 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 24 24 25 25 26 ## FABRUARY ## 26 ## JANUARY ## 27 imo = 0 28 ## ch1 ## 29 fovZen_ch1_JAN = np.where(fov1_JAN == 15.) 30 bbemis_ch1_JAN = nonzero((emis1_JAN[fovZen_ch1_JAN] != -500.) & (emis1_JAN[fovZen_ch1_JAN] <= 1.)) 31 OUTZCH1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 32 outzch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 33 lonch1_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 34 latch1_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 35 ## ch15 ## 36 fovZen_ch15_JAN = np.where(fov15_JAN == 15.) 37 bbemis_ch15_JAN = nonzero((emis15_JAN[fovZen_ch15_JAN] != -500.) & (emis15_JAN[fovZen_ch15_JAN] <= 1.)) 38 OUTZCH15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 39 outzch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 40 lonch15_JAN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 41 latch15_JAN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 42 for 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 69 OUTZ_JAN = np.array([OUTZCH1_JAN, OUTZCH15_JAN]) 70 71 72 ## FEBRUARY ## 27 73 imo = 1 28 74 ## ch1 ## … … 71 117 OUTZ_FEB = np.array([OUTZCH1_FEB, OUTZCH15_FEB]) 72 118 119 ## MARCH ## 120 imo = 2 121 ## ch1 ## 122 fovZen_ch1_MAR = np.where(fov1_MAR == 15.) 123 bbemis_ch1_MAR = nonzero((emis1_MAR[fovZen_ch1_MAR] != -500.) & (emis1_MAR[fovZen_ch1_MAR] <= 1.)) 124 OUTZCH1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 125 outzch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 126 lonch1_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) 127 latch1_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) 128 ## ch15 ## 129 fovZen_ch15_MAR = np.where(fov15_MAR == 15.) 130 bbemis_ch15_MAR = nonzero((emis15_MAR[fovZen_ch15_MAR] != -500.) & (emis15_MAR[fovZen_ch15_MAR] <= 1.)) 131 OUTZCH15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 132 outzch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 133 lonch15_MAR = np.zeros([len(np.arange(x0, x1+1, dx))], float) 134 latch15_MAR = np.zeros([len(np.arange(y0, y1+1, dy))], float) 135 for 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 162 OUTZ_MAR = np.array([OUTZCH1_MAR, OUTZCH15_MAR]) 163 164 73 165 ## APRIL ## 74 166 imo = 3 … … 117 209 OUTZ_APR = np.array([OUTZCH1_APR, OUTZCH15_APR]) 118 210 211 ## MAY ## 212 imo = 4 213 ## ch1 ## 214 fovZen_ch1_MAY = np.where(fov1_MAY == 15.) 215 bbemis_ch1_MAY = nonzero((emis1_MAY[fovZen_ch1_MAY] != -500.) & (emis1_MAY[fovZen_ch1_MAY] <= 1.)) 216 OUTZCH1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 217 outzch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 218 lonch1_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) 219 latch1_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) 220 ## ch15 ## 221 fovZen_ch15_MAY = np.where(fov15_MAY == 15.) 222 bbemis_ch15_MAY = nonzero((emis15_MAY[fovZen_ch15_MAY] != -500.) & (emis15_MAY[fovZen_ch15_MAY] <= 1.)) 223 OUTZCH15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 224 outzch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 225 lonch15_MAY = np.zeros([len(np.arange(x0, x1+1, dx))], float) 226 latch15_MAY = np.zeros([len(np.arange(y0, y1+1, dy))], float) 227 for 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 254 OUTZ_MAY = np.array([OUTZCH1_MAY, OUTZCH15_MAY]) 255 256 257 ## JUNE ## 258 imo = 5 259 ## ch1 ## 260 fovZen_ch1_JUN = np.where(fov1_JUN == 15.) 261 bbemis_ch1_JUN = nonzero((emis1_JUN[fovZen_ch1_JUN] != -500.) & (emis1_JUN[fovZen_ch1_JUN] <= 1.)) 262 OUTZCH1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 263 outzch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 264 lonch1_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 265 latch1_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 266 ## ch15 ## 267 fovZen_ch15_JUN = np.where(fov15_JUN == 15.) 268 bbemis_ch15_JUN = nonzero((emis15_JUN[fovZen_ch15_JUN] != -500.) & (emis15_JUN[fovZen_ch15_JUN] <= 1.)) 269 OUTZCH15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx)),len_month[imo]], float) 270 outzch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy)),len(np.arange(x0, x1+1, dx))], float) 271 lonch15_JUN = np.zeros([len(np.arange(x0, x1+1, dx))], float) 272 latch15_JUN = np.zeros([len(np.arange(y0, y1+1, dy))], float) 273 for 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 300 OUTZ_JUN = np.array([OUTZCH1_JUN, OUTZCH15_JUN]) 301 119 302 120 303 ## JULY ## … … 167 350 ## calcul de la climatologie moyenne par mois ## 168 351 ################################################ 169 lon = lonch1_FEB = lonch15_FEB = lonch1_APR = lonch15_APR 170 lat = latch1_FEB = latch15_FEB = latch1_APR = latch15_APR 352 lon = lonch1_FEB 353 lat = latch1_FEB 354 ## JANUARY ## 355 mean_outz_JAN = np.zeros([len(chan), len(lat), len(lon)], float) 356 for 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 171 361 ## FEBRUARY ## 172 362 mean_outz_FEB = np.zeros([len(chan), len(lat), len(lon)], float) … … 176 366 mean_outz_FEB[ich, ilat, ilon] = mean(OUTZ_FEB[ich, ilat, ilon, :][nonzero(isnan(OUTZ_FEB[ich, ilat, ilon, :]) == False)]) 177 367 368 ## MARCH ## 369 mean_outz_MAR = np.zeros([len(chan), len(lat), len(lon)], float) 370 for 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 178 375 ## APRIL ## 179 376 mean_outz_APR = np.zeros([len(chan), len(lat), len(lon)], float) … … 183 380 mean_outz_APR[ich, ilat, ilon] = mean(OUTZ_APR[ich, ilat, ilon, :][nonzero(isnan(OUTZ_APR[ich, ilat, ilon, :]) == False)]) 184 381 382 ## MAY ## 383 mean_outz_MAY = np.zeros([len(chan), len(lat), len(lon)], float) 384 for 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 ## 390 mean_outz_JUN = np.zeros([len(chan), len(lat), len(lon)], float) 391 for 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 185 396 ## JULY ## 186 397 mean_outz_JUL = np.zeros([len(chan), len(lat), len(lon)], float) … … 191 402 192 403 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): 404 mean_outz1 = np.array([mean_outz_FEB, mean_outz_APR, mean_outz_JUL]) 405 mean_outz2 = np.array([mean_outz_JAN, mean_outz_MAR, mean_outz_MAY, mean_outz_JUN]) 406 407 408 409 month_red = np.array(['JANUARY', 'MARCH', 'MAY', 'JUNE']) 410 for imo in range (0, 4): 197 411 plt.figure() 198 412 plt.ion() … … 205 419 xii,yii = m(*np.meshgrid(lon, lat)) 206 420 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) 208 422 cbar = colorbar(cs) 209 423 cbar.set_label(chan[ich]+' - 23.8GHz - ' + month_red[imo] + ' - AMSUA') … … 260 474 xii,yii = m(*np.meshgrid(lon, lat)) 261 475 #clevs = (arange(0., 0.006, 0.00001)) 262 cs = m.contourf(xii, yii, var_JUL[0, :, :], cmap=cm.s3pcpn_l_r)476 cs = m.contourf(xii, yii, monthly_emis_JUL[0, :, :], cmap=cm.s3pcpn_l_r) 263 477 cbar = colorbar(cs) 264 478 cbar.set_label('CH1 - 23.8GHz') -
trunk/src/scripts_Laura/write_netcdf_AMSUA_test.py
r24 r25 14 14 ############################ 15 15 month = 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') 17 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_JAN-MAR-MAY-JUN_ANTARC.nc', 'w', format = 'NETCDF4') 17 18 rootgrp.createDimension('longitude', len(lon)) 18 19 rootgrp.createDimension('latitude', len(lat)) 19 20 rootgrp.createDimension('channels', 2) 20 rootgrp.createDimension('month', 3)21 rootgrp.createDimension('month', 4) 21 22 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 22 23 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) … … 27 28 nclat[:] = lat 28 29 ncchan[:] = [23.8, 89] 29 ncmon[:] = [1., 2., 3. ]30 ncemis[:] = mean_outz 30 ncmon[:] = [1., 2., 3., 4.] 31 ncemis[:] = mean_outz2 31 32 32 33 rootgrp.close() … … 37 38 ## daily emisivity ## 38 39 ##################### 39 month_red = array(['FEBRUARY', 'APRIL', 'JULY']) 40 len_month_red = np.array([28, 30, 31]) 40 month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) 41 len_month = np.array([31, 28, 31, 30, 31, 30, 31]) 42 chan = array(['CH1', 'CH2']) 43 lon = lonch1_JAN 44 lat = latch1_JAN 45 46 ## JANUARY ## 41 47 imo = 0 42 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month _red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4')48 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 43 49 rootgrp.createDimension('longitude', len(lon)) 44 50 rootgrp.createDimension('latitude', len(lat)) 45 51 rootgrp.createDimension('channels', len(chan)) 46 rootgrp.createDimension('day', len_month _red[imo])52 rootgrp.createDimension('day', len_month[imo]) 47 53 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 48 54 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) … … 53 59 nclat[:] = lat 54 60 ncchan[:] = [23.8, 89] 55 ncjours[:] = np.arange(0, len_month _red[imo], 1)56 ncemis[:] = OUTZ_ FEB61 ncjours[:] = np.arange(0, len_month[imo], 1) 62 ncemis[:] = OUTZ_JAN 57 63 58 64 rootgrp.close() 59 65 66 67 ## FEBRUARY ## 60 68 imo = 1 61 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month _red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4')69 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 62 70 rootgrp.createDimension('longitude', len(lon)) 63 71 rootgrp.createDimension('latitude', len(lat)) 64 72 rootgrp.createDimension('channels', len(chan)) 65 rootgrp.createDimension('day', len_month _red[imo])73 rootgrp.createDimension('day', len_month[imo]) 66 74 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 67 75 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) … … 72 80 nclat[:] = lat 73 81 ncchan[:] = [23.8, 89] 74 ncjours[:] = np.arange(0, len_month _red[imo], 1)75 ncemis[:] = OUTZ_ APR82 ncjours[:] = np.arange(0, len_month[imo], 1) 83 ncemis[:] = OUTZ_FEB 76 84 77 85 rootgrp.close() 78 86 87 88 ## MARCH ## 79 89 imo = 2 80 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month _red[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4')90 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 81 91 rootgrp.createDimension('longitude', len(lon)) 82 92 rootgrp.createDimension('latitude', len(lat)) 83 93 rootgrp.createDimension('channels', len(chan)) 84 rootgrp.createDimension('day', len_month _red[imo])94 rootgrp.createDimension('day', len_month[imo]) 85 95 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 86 96 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) … … 91 101 nclat[:] = lat 92 102 ncchan[:] = [23.8, 89] 93 ncjours[:] = np.arange(0, len_month_red[imo], 1) 103 ncjours[:] = np.arange(0, len_month[imo], 1) 104 ncemis[:] = OUTZ_MAR 105 106 rootgrp.close() 107 108 109 ## APRIL ## 110 imo = 3 111 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 112 rootgrp.createDimension('longitude', len(lon)) 113 rootgrp.createDimension('latitude', len(lat)) 114 rootgrp.createDimension('channels', len(chan)) 115 rootgrp.createDimension('day', len_month[imo]) 116 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 117 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 118 ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 119 ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 120 ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 121 nclon[:] =lon 122 nclat[:] = lat 123 ncchan[:] = [23.8, 89] 124 ncjours[:] = np.arange(0, len_month[imo], 1) 125 ncemis[:] = OUTZ_APR 126 127 rootgrp.close() 128 129 130 ## MAY ## 131 imo = 4 132 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 133 rootgrp.createDimension('longitude', len(lon)) 134 rootgrp.createDimension('latitude', len(lat)) 135 rootgrp.createDimension('channels', len(chan)) 136 rootgrp.createDimension('day', len_month[imo]) 137 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 138 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 139 ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 140 ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 141 ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 142 nclon[:] =lon 143 nclat[:] = lat 144 ncchan[:] = [23.8, 89] 145 ncjours[:] = np.arange(0, len_month[imo], 1) 146 ncemis[:] = OUTZ_MAY 147 148 rootgrp.close() 149 150 151 ## JUNE ## 152 imo = 5 153 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 154 rootgrp.createDimension('longitude', len(lon)) 155 rootgrp.createDimension('latitude', len(lat)) 156 rootgrp.createDimension('channels', len(chan)) 157 rootgrp.createDimension('day', len_month[imo]) 158 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 159 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 160 ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 161 ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 162 ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 163 nclon[:] =lon 164 nclat[:] = lat 165 ncchan[:] = [23.8, 89] 166 ncjours[:] = np.arange(0, len_month[imo], 1) 167 ncemis[:] = OUTZ_JUN 168 169 rootgrp.close() 170 171 172 ## JUlY## 173 imo = 6 174 rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_ANTARC.nc', 'w', format = 'NETCDF4') 175 rootgrp.createDimension('longitude', len(lon)) 176 rootgrp.createDimension('latitude', len(lat)) 177 rootgrp.createDimension('channels', len(chan)) 178 rootgrp.createDimension('day', len_month[imo]) 179 nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) 180 nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) 181 ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) 182 ncjours = rootgrp.createVariable('day', 'f8', ('day',)) 183 ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) 184 nclon[:] =lon 185 nclat[:] = lat 186 ncchan[:] = [23.8, 89] 187 ncjours[:] = np.arange(0, len_month[imo], 1) 94 188 ncemis[:] = OUTZ_JUL 95 189 … … 101 195 102 196 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.