[Yt-svn] yt-commit r515 - trunk/yt/raven

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Mon Jun 2 10:39:23 PDT 2008


Author: mturk
Date: Mon Jun  2 10:39:22 2008
New Revision: 515
URL: http://yt.spacepope.org/changeset/515

Log:
Fixes for the contour callback object.



Modified:
   trunk/yt/raven/Callbacks.py

Modified: trunk/yt/raven/Callbacks.py
==============================================================================
--- trunk/yt/raven/Callbacks.py	(original)
+++ trunk/yt/raven/Callbacks.py	Mon Jun  2 10:39:22 2008
@@ -107,6 +107,8 @@
 class ContourCallback(PlotCallback):
     def __init__(self, field, ncont=5, factor=4, take_log=False, clim=None):
         PlotCallback.__init__(self)
+        self.ncont = ncont
+        self.field = field
         self.factor = factor
         self.take_log = take_log
         try:
@@ -137,7 +139,7 @@
                           0:numPoints_y:numPoints_y/(self.factor*1j)]
         x = (plot.data["px"][wI]-x0)*dx
         y = (plot.data["py"][wI]-y0)*dy
-        z = plot.data[field][wI]
+        z = plot.data[self.field][wI]
         if self.take_log: z=na.log10(z)
         zi = self.de.Triangulation(x,y).nn_interpolator(z)(xi,yi)
         plot._axes.contour(xi,yi,zi,self.ncont,colors='k')



More information about the yt-svn mailing list