<p><b>mhoffman@lanl.gov</b> 2012-08-07 10:42:24 -0600 (Tue, 07 Aug 2012)</p><p>BRANCH COMMIT - land ice<br>
Modification to plotting script to allow it to still work with a subset of grid variables present.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/grid_tools/plot_mpas_field.py
===================================================================
--- branches/land_ice_projects/grid_tools/plot_mpas_field.py        2012-08-06 20:46:11 UTC (rev 2091)
+++ branches/land_ice_projects/grid_tools/plot_mpas_field.py        2012-08-07 16:42:24 UTC (rev 2092)
@@ -62,12 +62,22 @@
# Get grid stuff
#times = f.variables['xtime'] # Not needed unless trying to print actual time stamp
-xCell = f.variables['xCell']
-yCell = f.variables['yCell']
-xEdge = f.variables['xEdge']
-yEdge = f.variables['yEdge']
-angleEdge = f.variables['angleEdge']
+try:
+ xCell = f.variables['xCell']
+ yCell = f.variables['yCell']
+except:
+ print 'xCell and/or yCell is/are missing. Might not be a problem.'
+try:
+ xEdge = f.variables['xEdge']
+ yEdge = f.variables['yEdge']
+except:
+ print 'xEdge and/or yEdge is/are missing. Might not be a problem.'
+try:
+ angleEdge = f.variables['angleEdge']
+except:
+ print 'angleEdge is missing. Might not be a problem.'
+
# get the requested variable
if varname == 'uMag':
uReconstructX = f.variables['uReconstructX']
@@ -126,7 +136,7 @@
print '** Beginning to create plot.'
fig = plt.figure(1, facecolor='w')
ax = fig.add_subplot(111, aspect='equal')
-plt.scatter(xCell[:], yCell[:], 3, var_slice, marker='o', edgecolors='none', vmin=minval, vmax=maxval)
+plt.scatter(xCell[:], yCell[:], 60, var_slice, marker='h', edgecolors='none', vmin=minval, vmax=maxval)
plt.colorbar()
plt.title( plottitle )
plt.draw()
</font>
</pre>