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

britton at wrangler.dreamhost.com britton at wrangler.dreamhost.com
Fri Sep 4 09:28:06 PDT 2009


Author: britton
Date: Fri Sep  4 09:28:05 2009
New Revision: 1430
URL: http://yt.spacepope.org/changeset/1430

Log:
Added dm_only keyword to particle callback to get only dark matter particles 
if no particle type is available.


Modified:
   trunk/yt/raven/Callbacks.py

Modified: trunk/yt/raven/Callbacks.py
==============================================================================
--- trunk/yt/raven/Callbacks.py	(original)
+++ trunk/yt/raven/Callbacks.py	Fri Sep  4 09:28:05 2009
@@ -744,7 +744,7 @@
     _type_name = "particles"
     region = None
     _descriptor = None
-    def __init__(self, width, p_size=1.0, col='k', stride=1.0, ptype=None, stars_only=False):
+    def __init__(self, width, p_size=1.0, col='k', stride=1.0, ptype=None, stars_only=False, dm_only=False):
         """
         Adds particle positions, based on a thick slab along *axis* with a
         *width* along the line of sight.  *p_size* controls the number of
@@ -758,6 +758,7 @@
         self.stride = stride
         self.ptype = ptype
         self.stars_only = stars_only
+        self.dm_only = dm_only
 
     def __call__(self, plot):
         data = plot.data
@@ -777,6 +778,9 @@
         if self.stars_only:
             gg &= (reg["creation_time"] > 0.0)
             if gg.sum() == 0: return
+        if self.dm_only:
+            gg &= (reg["creation_time"] <= 0.0)
+            if gg.sum() == 0: return
         plot._axes.hold(True)
         px, py = self.convert_to_pixels(plot,
                     [reg[field_x][gg][::self.stride],



More information about the yt-svn mailing list