<p><b>dwj07@fsu.edu</b> 2012-03-16 11:03:31 -0600 (Fri, 16 Mar 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Moving python visualization script into viz_tools directory.<br>
</p><hr noshade><pre><font color="gray">Deleted: branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py
===================================================================
--- branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py        2012-03-16 16:57:55 UTC (rev 1661)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py        2012-03-16 17:03:31 UTC (rev 1662)
@@ -1,124 +0,0 @@
-#!/usr/bin/python
-import sys, os, glob, shutil, numpy
-
-sys.path.append('/home/douglasj/softwares/python/lib/python2.7/site-packages')
-
-from netCDF4 import *
-from netCDF4 import Dataset as NetCDFFile
-from pylab import *
-
-from optparse import OptionParser
-
-import time
-import matplotlib
-import matplotlib.pyplot as plt
-from scipy.interpolate import griddata
-
-parser = OptionParser()
-parser.add_option(&quot;-f&quot;, &quot;--file&quot;, dest=&quot;filename&quot;, help=&quot;file to visualize&quot;, metavar=&quot;FILE&quot;)
-parser.add_option(&quot;-v&quot;, &quot;--var&quot;, dest=&quot;variable&quot;, help=&quot;variable to visualize&quot;, metavar=&quot;VAR&quot;)
-parser.add_option(&quot;--max&quot;, dest=&quot;maximum&quot;, help=&quot;maximum for color bar&quot;, metavar=&quot;MAX&quot;)
-parser.add_option(&quot;--min&quot;, dest=&quot;minimum&quot;, help=&quot;minimum for color bar&quot;, metavar=&quot;MIN&quot;)
-
-options, args = parser.parse_args()
-
-if not options.filename:
-        parser.error(&quot;Filename is a required input.&quot;)
-
-if not options.variable:
-        parser.error(&quot;Variable is a required input.&quot;)
-
-if not options.maximum:
-        color_max = 0.0
-else:
-        color_max = float(options.maximum)
-
-if not options.minimum:
-        color_min = 0.0
-else:
-        color_min = float(options.minimum)
-
-f = NetCDFFile(options.filename,'r')
-
-times = f.variables['xtime']
-field = f.variables[options.variable]
-
-dim = field.dimensions[1]
-if dim == &quot;nCells&quot;:
-        x = f.variables['xCell'][:]
-        y = f.variables['yCell'][:]
-elif dim == &quot;nEdges&quot;:
-        x = f.variables['xEdge'][:]
-        y = f.variables['yEdge'][:]
-elif dim == &quot;nVertices&quot;:
-        x = f.variables['xVertex'][:]
-        y = f.variables['yVertex'][:]
-
-dcedge = f.variables['dcEdge']
-vert_levs = len(f.dimensions['nVertLevels'])
-
-junk = dcedge[:]
-resolution = junk.max()
-
-del dcedge
-del junk
-
-nx = int((x.max() - x.min())/resolution - 1)
-ny = int((y.max() - y.min())/resolution)
-
-time_length = times.shape[0]
-
-del times
-
-print &quot;nx = &quot;, nx, &quot; ny = &quot;, ny
-print &quot;vert_levs = &quot;, vert_levs, &quot; time_length = &quot;, time_length
-
-print &quot;Computing global max and min&quot;
-junk = field[:,:,0]
-maxval = junk.max()
-minval = junk.min()
-
-del junk
-
-junk = field[:,:,:]
-global_max = junk.max()
-global_min = junk.min()
-
-del junk
-
-print &quot;Global max = &quot;, global_max, &quot; Global min = &quot;, global_min
-print &quot;Surface max = &quot;, maxval, &quot; Surface min = &quot;, minval
-
-if color_max == color_min:
-        color_max = global_max
-        color_min = global_min
-
-steps = 30
-step = (color_max - color_min) / steps
-color_bar_levels = arange(color_min-step, color_max+step, step)
-
-xi = linspace(x.min(), x.max(), nx*2)
-yi = linspace(y.min(), y.max(), ny*2)
-
-zi = griddata((x, y), field[0,:,0], (xi[None,:], yi[:,None]), method='linear')
-
-plt.ion()
-fig = plt.figure(1)
-ax = fig.add_subplot(111)
-
-plt.contourf(xi, yi, zi, levels=color_bar_levels)
-plt.colorbar()
-plt.draw()
-
-for t in range(1, time_length):
-         ax.cla()
-        zi = griddata((x, y), field[t,:,0], (xi[None,:], yi[:,None]), method='linear')

-        plt.contourf(xi, yi, zi, levels=color_bar_levels)
-        plt.draw()
-         time.sleep(0.05)
-
-plt.ioff()
-
-plt.show()
-f.close()

Copied: branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/viz_tools/python/visualize_channel.py (from rev 1661, branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py)
===================================================================
--- branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/viz_tools/python/visualize_channel.py                                (rev 0)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/viz_tools/python/visualize_channel.py        2012-03-16 17:03:31 UTC (rev 1662)
@@ -0,0 +1,133 @@
+#!/usr/bin/python
+import sys, os, glob, shutil, numpy
+
+## Need to edit this to include the path to the netcdf4 site packages for
+## your python version
+sys.path.append('PATH_TO_NETCDF4')
+
+from netCDF4 import *
+from netCDF4 import Dataset as NetCDFFile
+from pylab import *
+
+from optparse import OptionParser
+
+import time
+import matplotlib
+import matplotlib.pyplot as plt
+from scipy.interpolate import griddata
+
+## Get command line parameters
+parser = OptionParser()
+parser.add_option(&quot;-f&quot;, &quot;--file&quot;, dest=&quot;filename&quot;, help=&quot;file to visualize&quot;, metavar=&quot;FILE&quot;)
+parser.add_option(&quot;-v&quot;, &quot;--var&quot;, dest=&quot;variable&quot;, help=&quot;variable to visualize&quot;, metavar=&quot;VAR&quot;)
+parser.add_option(&quot;--max&quot;, dest=&quot;maximum&quot;, help=&quot;maximum for color bar&quot;, metavar=&quot;MAX&quot;)
+parser.add_option(&quot;--min&quot;, dest=&quot;minimum&quot;, help=&quot;minimum for color bar&quot;, metavar=&quot;MIN&quot;)
+
+options, args = parser.parse_args()
+
+if not options.filename:
+        parser.error(&quot;Filename is a required input.&quot;)
+
+if not options.variable:
+        parser.error(&quot;Variable is a required input.&quot;)
+
+if not options.maximum:
+        color_max = 0.0
+else:
+        color_max = float(options.maximum)
+
+if not options.minimum:
+        color_min = 0.0
+else:
+        color_min = float(options.minimum)
+
+## Read fields from netcdf file
+f = NetCDFFile(options.filename,'r')
+
+times = f.variables['xtime']
+field = f.variables[options.variable]
+
+dim = field.dimensions[1]
+if dim == &quot;nCells&quot;:
+        x = f.variables['xCell'][:]
+        y = f.variables['yCell'][:]
+elif dim == &quot;nEdges&quot;:
+        x = f.variables['xEdge'][:]
+        y = f.variables['yEdge'][:]
+elif dim == &quot;nVertices&quot;:
+        x = f.variables['xVertex'][:]
+        y = f.variables['yVertex'][:]
+
+dcedge = f.variables['dcEdge']
+vert_levs = len(f.dimensions['nVertLevels'])
+
+junk = dcedge[:]
+resolution = junk.max()
+
+del dcedge
+del junk
+
+## Compute nx and ny from netcdf file
+nx = int((x.max() - x.min())/resolution - 1)
+ny = int((y.max() - y.min())/resolution)
+
+time_length = times.shape[0]
+
+del times
+
+print &quot;nx = &quot;, nx, &quot; ny = &quot;, ny
+print &quot;vert_levs = &quot;, vert_levs, &quot; time_length = &quot;, time_length
+
+print &quot;Computing global max and min&quot;
+junk = field[:,:,0]
+maxval = junk.max()
+minval = junk.min()
+
+del junk
+
+junk = field[:,:,:]
+global_max = junk.max()
+global_min = junk.min()
+
+del junk
+
+print &quot;Global max = &quot;, global_max, &quot; Global min = &quot;, global_min
+print &quot;Surface max = &quot;, maxval, &quot; Surface min = &quot;, minval
+
+if color_max == color_min:
+        color_max = global_max
+        color_min = global_min
+
+## Build color bar
+steps = 30
+step = (color_max - color_min) / steps
+color_bar_levels = arange(color_min-step, color_max+step, step)
+
+## Create regular grid
+xi = linspace(x.min(), x.max(), nx*2)
+yi = linspace(y.min(), y.max(), ny*2)
+
+## Interpolate field onto regular grid
+zi = griddata((x, y), field[0,:,0], (xi[None,:], yi[:,None]), method='linear')
+
+## Plot interpolated data
+plt.ion()
+fig = plt.figure(1)
+ax = fig.add_subplot(111)
+
+plt.contourf(xi, yi, zi, levels=color_bar_levels)
+plt.colorbar()
+plt.draw()
+
+for t in range(1, time_length):
+         ax.cla()
+        zi = griddata((x, y), field[t,:,0], (xi[None,:], yi[:,None]), method='linear')

+        plt.contourf(xi, yi, zi, levels=color_bar_levels)
+        plt.draw()
+         time.sleep(0.05)
+
+plt.ioff()
+
+plt.show()
+f.close()

</font>
</pre>