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

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Jun 17 15:09:33 PDT 2010


Author: mturk
Date: Thu Jun 17 15:09:32 2010
New Revision: 1751
URL: http://yt.enzotools.org/changeset/1751

Log:
Update halo profiler and plot collection to work with new plot collection.



Modified:
   trunk/yt/extensions/halo_profiler.py
   trunk/yt/lagos/BaseDataTypes.py
   trunk/yt/raven/plot_collection.py

Modified: trunk/yt/extensions/halo_profiler.py
==============================================================================
--- trunk/yt/extensions/halo_profiler.py	(original)
+++ trunk/yt/extensions/halo_profiler.py	Thu Jun 17 15:09:32 2010
@@ -394,7 +394,7 @@
         return profile
 
     @lagos.parallel_blocking_call
-    def make_projections(self, axes=[0, 1, 2], halo_list='filtered', save_images=False, save_cube=True, **kwargs):
+    def make_projections(self, axes=[0, 1, 2], halo_list='filtered', save_images=False, save_cube=True):
         "Make projections of all halos using specified fields."
 
         # Get list of halos for projecting.
@@ -430,9 +430,6 @@
         center = [0.5 * (self.pf.parameters['DomainLeftEdge'][w] + self.pf.parameters['DomainRightEdge'][w])
                   for w in range(self.pf.parameters['TopGridRank'])]
 
-        # Create a plot collection.
-        pc = raven.PlotCollection(self.pf, center=center)
-
         for halo in self._get_objs('_halo_projection_list', round_robin=True):
             if halo is None:
                 continue
@@ -461,6 +458,8 @@
             # Make projections.
             if not isinstance(axes, types.ListType): axes = list([axes])
             for w in axes:
+                # Create a plot collection.
+                pc = raven.PlotCollection(self.pf, center=center)
                 # YT projections do not follow the right-hand rule.
                 coords = range(3)
                 del coords[w]
@@ -468,8 +467,7 @@
                 y_axis = coords[1]
 
                 for hp in self.projection_fields:
-                    pc.add_projection(hp['field'], w, weight_field=hp['weight_field'], source=region, lazy_reader=False,
-                                      serialize=False, **kwargs)
+                    pc.add_projection(hp['field'], w, weight_field=hp['weight_field'], data_source=region)
                 
                 # Set x and y limits, shift image if it overlaps domain boundary.
                 if need_per:
@@ -506,9 +504,7 @@
                 if save_images:
                     pc.save("%s/Halo_%04d" % (outputDir, halo['id']), force_save=True)
 
-                pc.clear_plots()
             del region
-        del pc
 
     def _add_actual_overdensity(self, profile):
         "Calculate overdensity from TotalMassMsun and CellVolume fields."

Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py	(original)
+++ trunk/yt/lagos/BaseDataTypes.py	Thu Jun 17 15:09:32 2010
@@ -2023,8 +2023,8 @@
               + (grid['z'] - self.center[2])**2.0
                 )
             r = na.sqrt(d**2.0-h**2.0)
-            cm = ( (na.abs(h) < self._height)
-                 & (r < self._radius))
+            cm = ( (na.abs(h) <= self._height)
+                 & (r <= self._radius))
         return cm
 
     def volume(self, unit="unitary"):

Modified: trunk/yt/raven/plot_collection.py
==============================================================================
--- trunk/yt/raven/plot_collection.py	(original)
+++ trunk/yt/raven/plot_collection.py	Thu Jun 17 15:09:32 2010
@@ -707,6 +707,7 @@
         >>> pc = PlotCollection(pf, [0.5, 0.5, 0.5])
         >>> p = pc.add_projection("Density", 0, "Density")
         """
+        if field_parameters is None: field_parameters = {}
         if center == None:
             center = self.c
         if obj is None:



More information about the yt-svn mailing list