[yt-svn] commit/yt: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Feb 19 16:03:17 PST 2013


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/d14abb6b3387/
changeset:   d14abb6b3387
branch:      yt
user:        chummels
date:        2013-02-20 00:22:09
summary:     Adding optional parameters to draw_grids function for VRs to allow one to explicitly specify the level of the grids to overplot.
affected #:  1 file

diff -r 93ca9ea45b7765e77b770503be39e2166631ab16 -r d14abb6b3387553f2be81c18802f71386f6c3358 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -267,7 +267,8 @@
         px = (res[1]*(dy/self.width[1])).astype('int')
         return px, py, dz
 
-    def draw_grids(self, im, alpha=0.3, cmap='algae'):
+    def draw_grids(self, im, alpha=0.3, cmap='algae', min_level=None, 
+                   max_level=None):
         r"""Draws Grids on an existing volume rendering.
 
         By mapping grid level to a color, drawes edges of grids on 
@@ -284,6 +285,9 @@
             Default : 0.3
         cmap : string, optional
             Colormap to be used mapping grid levels to colors.
+        min_level, max_level : int, optional
+            Optional parameters to specify the min and max level grid boxess 
+            to overplot on the image.  
         
         Returns
         -------
@@ -298,6 +302,16 @@
         """
         corners = self.pf.h.grid_corners
         levels = self.pf.h.grid_levels[:,0]
+
+        if max_level is not None:
+            subset = levels <= max_level
+            levels = levels[subset]
+            corners = corners[:,:,subset]
+        if min_level is not None:
+            subset = levels >= min_level
+            levels = levels[subset]
+            corners = corners[:,:,subset]
+            
         colors = apply_colormap(levels*1.0,
                                 color_bounds=[0,self.pf.h.max_level],
                                 cmap_name=cmap)[0,:,:]*1.0/255.


https://bitbucket.org/yt_analysis/yt/commits/db1d8020d9fb/
changeset:   db1d8020d9fb
branch:      yt
user:        samskillman
date:        2013-02-20 01:02:36
summary:     Fixing a typo.
affected #:  1 file

diff -r d14abb6b3387553f2be81c18802f71386f6c3358 -r db1d8020d9fb8484147d65366968b012db4d0b50 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -286,7 +286,7 @@
         cmap : string, optional
             Colormap to be used mapping grid levels to colors.
         min_level, max_level : int, optional
-            Optional parameters to specify the min and max level grid boxess 
+            Optional parameters to specify the min and max level grid boxes 
             to overplot on the image.  
         
         Returns

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list