[yt-svn] commit/yt: MatthewTurk: Adding option of centering with 'c' or 'center' for data objects.

Bitbucket commits-noreply at bitbucket.org
Thu May 17 23:15:02 PDT 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/e4de6464d110/
changeset:   e4de6464d110
branch:      yt
user:        MatthewTurk
date:        2012-05-18 05:12:05
summary:     Adding option of centering with 'c' or 'center' for data objects.
affected #:  1 file

diff -r 3442625bb24f66b1cd15273f7feb708342bad20a -r e4de6464d110fcd21a9c11e6bbae6157f811647f yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -240,6 +240,8 @@
             pass
         elif isinstance(center, (types.ListType, types.TupleType, na.ndarray)):
             center = na.array(center)
+        elif center in ("c", "center"):
+            center = self.pf.domain_center
         elif center == ("max"): # is this dangerous for race conditions?
             center = self.pf.h.find_max("Density")[1]
         elif center.startswith("max_"):

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