<p><b>dwj07@fsu.edu</b> 2012-02-22 15:48:57 -0700 (Wed, 22 Feb 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding a python visualization script for the baroclinic channel test case.<br>
</p><hr noshade><pre><font color="gray">Added: branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/netCDF.pyc
===================================================================
(Binary files differ)


Property changes on: branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/netCDF.pyc
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: 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                                (rev 0)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py        2012-02-22 22:48:57 UTC (rev 1529)
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+import sys, os, glob, shutil, numpy
+from netCDF import *
+from pylab import *
+
+from optparse import OptionParser
+
+import time
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.contour import QuadContourSet
+
+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;)
+
+options, args = parser.parse_args()
+
+x_length = 160000
+y_length = 500000
+
+steps = 40
+
+f = NetCDFFile(options.filename,'r')
+
+times = f.variables['xtime']
+temperature = f.variables[options.variable]
+dcedge = f.variables['dcEdge']
+
+junk = dcedge[:]
+resolution = junk.max()
+
+del dcedge
+del junk
+
+nx = x_length/resolution
+ny = y_length/resolution
+vert_levs = 20
+
+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 = temperature[:,:,0]
+maxval = junk.max()
+minval = junk.min()
+
+del junk
+
+global_max = maxval
+global_min = minval
+
+for lev in range(1, vert_levs):
+        junk = temperature[:,:,lev]
+        global_max = max(junk.max(), global_max)
+        global_min = min(junk.min(), global_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
+
+step = (maxval - minval) / steps
+color_bar_levels = arange(minval-step, maxval+2*step, step)
+
+temp_slice = temperature[0, :, 0]
+temp_slice = temp_slice.reshape(ny, nx)
+
+plt.ion()
+fig = plt.figure(1)
+ax = fig.add_subplot(111)
+
+C = plt.contourf(temp_slice[:,:], levels=color_bar_levels)
+plt.colorbar()
+plt.draw()
+
+for t in range( 1, time_length):
+         ax.cla()
+          temp_slice = temperature[t, :, 0]
+          temp_slice = temp_slice.reshape(ny, nx)

+        C = plt.contourf(temp_slice[:,:], levels=color_bar_levels)
+        plt.draw()
+         time.sleep(0.05)
+
+plt.ioff()
+
+plt.show()
+f.close()


Property changes on: branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py
___________________________________________________________________
Added: svn:executable
   + *

</font>
</pre>