[Yt-svn] yt: A couple more changes to halo_profiler to mesh with the plot...

hg at spacepope.org hg at spacepope.org
Mon Jun 14 11:20:06 PDT 2010


hg Repository: yt
details:   yt/rev/bb4ad402de94
changeset: 1777:bb4ad402de94
user:      Stephen Skory <stephenskory at yahoo.com>
date:
Mon Jun 14 11:19:54 2010 -0700
description:
A couple more changes to halo_profiler to mesh with the plot_collection changes.

diffstat:

 yt/extensions/halo_profiler.py |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r aed9ff31fd38 -r bb4ad402de94 yt/extensions/halo_profiler.py
--- a/yt/extensions/halo_profiler.py	Sat Jun 12 14:54:57 2010 -0700
+++ b/yt/extensions/halo_profiler.py	Mon Jun 14 11:19:54 2010 -0700
@@ -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'], data_source=region, lazy_reader=False,
-                                      serialize=False)
+                    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."



More information about the yt-svn mailing list