Changeset 877 for trunk/UTIL/PYTHON/myplot.py
- Timestamp:
- Feb 11, 2013, 5:21:29 PM (12 years ago)
- File:
-
- 1 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))
Note: See TracChangeset
for help on using the changeset viewer.