[Yt-svn] yt-commit r1266 - trunk/yt/raven
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Mon Apr 20 14:44:46 PDT 2009
Author: mturk
Date: Mon Apr 20 14:44:46 2009
New Revision: 1266
URL: http://yt.spacepope.org/changeset/1266
Log:
Added a width argument to the hop circle callback, closing #194
Modified:
trunk/yt/raven/Callbacks.py
Modified: trunk/yt/raven/Callbacks.py
==============================================================================
--- trunk/yt/raven/Callbacks.py (original)
+++ trunk/yt/raven/Callbacks.py Mon Apr 20 14:44:46 2009
@@ -593,7 +593,7 @@
def __init__(self, hop_output, max_number=None,
annotate=False, min_size=20, max_size=10000000,
font_size=8, print_halo_size=False,
- print_halo_mass=False):
+ print_halo_mass=False, width=None):
self.hop_output = hop_output
self.max_number = max_number
self.annotate = annotate
@@ -602,6 +602,7 @@
self.font_size = font_size
self.print_halo_size = print_halo_size
self.print_halo_mass = print_halo_mass
+ self.width = width
def __call__(self, plot):
from matplotlib.patches import Circle
@@ -615,6 +616,12 @@
for halo in self.hop_output[:self.max_number]:
size = halo.get_size()
if size < self.min_size or size > self.max_size: continue
+ # This could use halo.maximum_radius() instead of width
+ if self.width is not None and \
+ na.abs(halo.center_of_mass() -
+ plot.data.center)[plot.data.axis] > \
+ self.width:
+ continue
radius = halo.maximum_radius() * dx
center = halo.center_of_mass()
center_x = (center[xi] - x0)*dx
More information about the yt-svn
mailing list