<p><b>dwj07@fsu.edu</b> 2012-02-28 11:17:07 -0700 (Tue, 28 Feb 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding error output for incorrect calls to script.<br>
        Adding inputs for min and max on colorbar, which can be used in plotting different variables.<br>
</p><hr noshade><pre><font color="gray">Modified: 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-02-28 18:04:29 UTC (rev 1545)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/baroclinic_channel/visualize_channel.py        2012-02-28 18:17:07 UTC (rev 1546)
@@ -13,9 +13,27 @@
 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 = 13.0
+else:
+        color_max = float(options.maximum)
+
+if not options.minimum:
+        color_min = 11.0
+else:
+        color_min = float(options.minimum)
+
 x_length = 160000
 y_length = 500000
 
@@ -51,39 +69,33 @@
 
 del junk
 
-global_max = maxval
-global_min = minval
+junk = temperature[:,:,:]
+global_max = junk.max()
+global_min = junk.min()
 
-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
 
-        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)
+step = (color_max - color_min) / steps
+color_bar_levels = arange(color_min-step, color_max+step, step)
 
-temp_slice = temperature[0, :, 0]
-temp_slice = temp_slice.reshape(ny, nx)
+temp_slice = temperature[:, :, 0]
+temp_slice = temp_slice.reshape(time_length, ny, nx)
 
 plt.ion()
 fig = plt.figure(1)
 ax = fig.add_subplot(111)
 
-C = plt.contourf(temp_slice[:,:], levels=color_bar_levels)
+C = plt.contourf(temp_slice[0, :,:], 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)
+        C = plt.contourf(temp_slice[t, :,:], levels=color_bar_levels)
         plt.draw()
          time.sleep(0.05)
 

</font>
</pre>