Changeset 877
- Timestamp:
- Feb 11, 2013, 5:21:29 PM (12 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r876 r877 97 97 dimension = len(nc.variables[var].dimensions) 98 98 ## this allows to get much faster and use much less memory esp. with large datasets 99 if dimension == 2: field = nc.variables[var][indextime,indexlon] 100 elif dimension == 3: field = nc.variables[var][indextime,indexlat,indexlon] 101 elif dimension == 4: field = nc.variables[var][indextime,indexvert,indexlat,indexlon] 102 elif dimension == 1: field = nc.variables[var][indextime] 99 print " Opening variable",var," with", dimension, "dimensions ..." 100 if dimension == 2: 101 field = nc.variables[var][indextime,indexlon] 102 field = np.reshape(field,(len(indextime),len(indexlon))) 103 elif dimension == 3: 104 field = nc.variables[var][indextime,indexlat,indexlon] 105 field = np.reshape(field,(len(indextime),len(indexlat),len(indexlon))) 106 elif dimension == 4: 107 field = nc.variables[var][indextime,indexvert,indexlat,indexlon] 108 field = np.reshape(field,(len(indextime),len(indexvert),len(indexlat),len(indexlon))) 109 elif dimension == 1: 110 field = nc.variables[var][indextime] 111 field = np.reshape(field,(len(indextime))) 103 112 return field 104 113 … … 1358 1367 shape = what_I_plot.shape 1359 1368 if indextime is None and len(time) > 1: 1360 print "AXIS is time"1369 #print "AXIS is time" 1361 1370 x = time 1362 1371 count = count+1 1363 1372 if indexlon is None and len(lon) > 1 and redope not in ['edge_x1','edge_x2']: 1364 print "AXIS is lon"1373 #print "AXIS is lon" 1365 1374 if count == 0: x = lon 1366 1375 else: y = lon 1367 1376 count = count+1 1368 1377 if indexlat is None and len(lat) > 1 and redope not in ['edge_y1','edge_y2']: 1369 print "AXIS is lat"1378 #print "AXIS is lat" 1370 1379 if count == 0: x = lat 1371 1380 else: y = lat 1372 1381 count = count+1 1373 1382 if indexvert is None and len(vert) > 1 and ((dim0 == 4) or (y is None)): 1374 print "AXIS is vert"1383 #print "AXIS is vert" 1375 1384 if vertmode == 0: # vertical axis is as is (GCM grid) 1376 1385 if count == 0: x=range(len(vert)) -
trunk/UTIL/PYTHON/planetoplot.py
r876 r877 388 388 else: itime = range(len(time)) 389 389 390 all_time[k] = time[itime]391 all_vert[k] = vert[ivert]392 all_lat[k] = lat[ilat]393 all_lon[k] = lon[ilon]394 395 390 all_var[k] = myplot.getfieldred(nc,all_varname[k],ilon,ilat,ivert,itime) 396 391 if var2: all_var2[k] = myplot.getfieldred(nc,var2,ilon,ilat,ivert,itime) … … 399 394 all_windv[k] = myplot.getfield(nc,vchar,ilon,ilat,ivert,itime) 400 395 plot_x[k] = None ; plot_y[k] = None 396 397 all_time[k] = time[itime] 398 all_vert[k] = vert[ivert] 399 all_lat[k] = lat[ilat] 400 all_lon[k] = lon[ilon] 401 401 402 402 else:
Note: See TracChangeset
for help on using the changeset viewer.