[Yt-svn] yt-commit r1410 - in trunk/yt: lagos raven

jwise at wrangler.dreamhost.com jwise at wrangler.dreamhost.com
Tue Aug 25 09:43:02 PDT 2009


Author: jwise
Date: Tue Aug 25 09:43:02 2009
New Revision: 1410
URL: http://yt.spacepope.org/changeset/1410

Log:
Added the fixed resolution cutting plane to PlotCollection.


Modified:
   trunk/yt/lagos/BaseDataTypes.py
   trunk/yt/raven/PlotCollection.py

Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py	(original)
+++ trunk/yt/lagos/BaseDataTypes.py	Tue Aug 25 09:43:02 2009
@@ -973,6 +973,7 @@
         self.width = width
         self.dims = dims
         self.dds = self.width / self.dims
+        self.bounds = na.array([0.0,1.0,0.0,1.0])
         
         self.set_field_parameter('center', center)
         # Let's set up our plane equation
@@ -1091,7 +1092,7 @@
             self[field] = na.zeros(_size, dtype='float64')
             for grid in self._get_grids():
                 self._get_data_from_grid(grid, field)
-            self[field] = self._mpi_allsum(self[field]).reshape([self.dims]*2)#.transpose()
+            self[field] = self._mpi_allsum(self[field]).reshape([self.dims]*2).transpose()
 
     def interpolate_discretize(self, *args, **kwargs):
         pass

Modified: trunk/yt/raven/PlotCollection.py
==============================================================================
--- trunk/yt/raven/PlotCollection.py	(original)
+++ trunk/yt/raven/PlotCollection.py	Tue Aug 25 09:43:02 2009
@@ -251,6 +251,34 @@
         p["Axis"] = "CuttingPlane"
         return p
 
+    def add_fixed_res_cutting_plane \
+            (self, field, normal, width, res=512, center=None, use_colorbar=True,
+             figure = None, axes = None, fig_size=None, obj=None, **kwargs):
+        """
+        Generate a fixed resolution, interpolated cutting plane of
+        *field* with *normal*, centered at *center* (defaults to
+        PlotCollection center) with *use_colorbar* specifying whether
+        the plot is naked or not and optionally providing pre-existing
+        Matplotlib *figure* and *axes* objects.  *fig_size* in
+        (height_inches, width_inches).  If so desired, *obj* is a
+        pre-existing cutting plane object.
+        """
+        if center == None:
+            center = self.c
+        if not obj:
+            data = self.pf.hierarchy.fixed_res_cutting \
+                 (normal, center, width, res, **kwargs)
+            #data = frc[field]
+        else:
+            data = obj
+        p = self._add_plot(PlotTypes.FixedResolutionPlot(data, field,
+                         use_colorbar=use_colorbar, axes=axes, figure=figure,
+                         size=fig_size))
+        mylog.info("Added fixed-res plane of %s with 'center' = %s and "
+                   "normal = %s", field, list(center), list(normal))
+        p["Axis"] = "CuttingPlane"
+        return p
+
     def add_projection(self, *args, **kwargs):
         """
         Generate a projection of *field* along *axis*, optionally giving



More information about the yt-svn mailing list