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

sskory at wrangler.dreamhost.com sskory at wrangler.dreamhost.com
Thu Jan 22 11:31:14 PST 2009


Author: sskory
Date: Thu Jan 22 11:31:13 2009
New Revision: 1136
URL: http://yt.spacepope.org/changeset/1136

Log:
Added an option to print the halo mass in Msol with HOPCircleCallback

Modified:
   trunk/yt/raven/Callbacks.py

Modified: trunk/yt/raven/Callbacks.py
==============================================================================
--- trunk/yt/raven/Callbacks.py	(original)
+++ trunk/yt/raven/Callbacks.py	Thu Jan 22 11:31:13 2009
@@ -535,7 +535,8 @@
 
 class HopCircleCallback(PlotCallback):
     def __init__(self, hop_output, axis, max_number=None,
-                 annotate=False, min_size=20, font_size=8, print_halo_size=False):
+                 annotate=False, min_size=20, font_size=8, print_halo_size=False,
+                 print_halo_mass=False):
         self.axis = axis
         self.hop_output = hop_output
         self.max_number = max_number
@@ -543,6 +544,7 @@
         self.min_size = min_size
         self.font_size = font_size
         self.print_halo_size = print_halo_size
+        self.print_halo_mass = print_halo_mass
 
     def __call__(self, plot):
         from matplotlib.patches import Circle
@@ -566,6 +568,9 @@
                 if self.print_halo_size:
                     plot._axes.text(center_x, center_y, "%s" % size,
                     fontsize=self.font_size)
+                elif self.print_halo_mass:
+                    plot._axes_text(center_x, center_y, "%s" % halo.total_mass(),
+                    fontsize=self.font_size)
                 else:
                     plot._axes.text(center_x, center_y, "%s" % halo.id,
                     fontsize=self.font_size)



More information about the yt-svn mailing list