[yt-svn] commit/yt-3.0: MatthewTurk: Resetting cartesian_fields.py to *not* apply offsets or scaling.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Mar 19 11:35:10 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/b56fb7756976/
changeset:   b56fb7756976
branch:      yt-3.0
user:        MatthewTurk
date:        2013-03-19 12:32:43
summary:     Resetting cartesian_fields.py to *not* apply offsets or scaling.

Fixes #528.  Needs verification from other frontends.
affected #:  3 files

diff -r e4852e262442f29c5b2b30b8c5b8d38a2750ebef -r b56fb77569764f6f5fd8dc1416b6b182170345fe yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -265,7 +265,8 @@
 
     def select_fwidth(self, dobj):
         # Recall domain_dimensions is the number of cells, not octs
-        base_dx = 1.0/self.domain.pf.domain_dimensions
+        base_dx = (self.domain.pf.domain_width /
+                   self.domain.pf.domain_dimensions)
         widths = np.empty((self.cell_count, 3), dtype="float64")
         dds = (2**self.ires(dobj))
         for i in range(3):

diff -r e4852e262442f29c5b2b30b8c5b8d38a2750ebef -r b56fb77569764f6f5fd8dc1416b6b182170345fe yt/frontends/sph/data_structures.py
--- a/yt/frontends/sph/data_structures.py
+++ b/yt/frontends/sph/data_structures.py
@@ -92,7 +92,8 @@
 
     def select_fwidth(self, dobj):
         # Recall domain_dimensions is the number of cells, not octs
-        base_dx = 1.0/self.domain.pf.domain_dimensions
+        base_dx = (self.domain.pf.domain_width /
+                   self.domain.pf.domain_dimensions)
         widths = np.empty((self.cell_count, 3), dtype="float64")
         dds = (2**self.ires(dobj))
         for i in range(3):

diff -r e4852e262442f29c5b2b30b8c5b8d38a2750ebef -r b56fb77569764f6f5fd8dc1416b6b182170345fe yt/geometry/cartesian_fields.py
--- a/yt/geometry/cartesian_fields.py
+++ b/yt/geometry/cartesian_fields.py
@@ -41,26 +41,26 @@
 add_cart_field = CartesianFieldInfo.add_field
 
 def _dx(field, data):
-    return data.pf.domain_width[0] * data.fwidth[...,0]
+    return data.fwidth[...,0]
 add_cart_field('dx', function=_dx, display_field=False)
 
 def _dy(field, data):
-    return data.pf.domain_width[1] * data.fwidth[...,1]
+    return data.fwidth[...,1]
 add_cart_field('dy', function=_dy, display_field=False)
 
 def _dz(field, data):
-    return data.pf.domain_width[2] * data.fwidth[...,2]
+    return data.fwidth[...,2]
 add_cart_field('dz', function=_dz, display_field=False)
 
 def _coordX(field, data):
-    return data.pf.domain_left_edge[0] + data.fcoords[...,0]
+    return data.fcoords[...,0]
 add_cart_field('x', function=_coordX, display_field=False)
 
 def _coordY(field, data):
-    return data.pf.domain_left_edge[1] + data.fcoords[...,1]
+    return data.fcoords[...,1]
 add_cart_field('y', function=_coordY, display_field=False)
 
 def _coordZ(field, data):
-    return data.pf.domain_left_edge[2] + data.fcoords[...,2]
+    return data.fcoords[...,2]
 add_cart_field('z', function=_coordZ, display_field=False)

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

--

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