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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 25 11:46:37 PDT 2013


2 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/e7ba954cc1ca/
Changeset:   e7ba954cc1ca
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-25 19:52:45
Summary:     A possible solution to 32-bit particles that live on boundaries.

This fixes a problem where, with 32-bit positions in Tipsy frontends that
*exactly* touch the boundary, Octree nodes would be ill-defined because of the
morton ordering.  This ensures that particles live within the bounds by the
smallest-representable float for the dtype of the position provided in the
file.

I do not know if this is the best solution.
Affected #:  1 file

diff -r 250ee66bf0174aa0a1b807640b0e0a2109383c8b -r e7ba954cc1ca83c5541a697c7ba2003b6a7d69cc yt/frontends/sph/io.py
--- a/yt/frontends/sph/io.py
+++ b/yt/frontends/sph/io.py
@@ -446,9 +446,11 @@
                                                pf.domain_left_edge,
                                                pf.domain_right_edge)
                     pos = np.empty((pp.size, 3), dtype="float64")
-                    pos[:,0] = pp["Coordinates"]["x"]
-                    pos[:,1] = pp["Coordinates"]["y"]
-                    pos[:,2] = pp["Coordinates"]["z"]
+                    for i, ax in enumerate("xyz"):
+                        eps = np.finfo(pp["Coordinates"][ax].dtype).eps
+                        pos[:,i] = np.clip(pp["Coordinates"][ax],
+                                    pf.domain_left_edge[i] + eps,
+                                    pf.domain_right_edge[i] - eps)
                     regions.add_data_file(pos, data_file.file_id)
                     morton[ind:ind+c] = compute_morton(
                         pos[:,0], pos[:,1], pos[:,2],


https://bitbucket.org/yt_analysis/yt-3.0/commits/7ffc40eb2315/
Changeset:   7ffc40eb2315
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-25 20:01:00
Summary:     Another location for clipping Tipsy particles to epsilon bounds.
Affected #:  1 file

diff -r e7ba954cc1ca83c5541a697c7ba2003b6a7d69cc -r 7ffc40eb23159d00fa634703480757d0fed7088a yt/frontends/sph/io.py
--- a/yt/frontends/sph/io.py
+++ b/yt/frontends/sph/io.py
@@ -380,6 +380,12 @@
                 rv[field] = np.empty(size, dtype="float64")
                 if size == 0: continue
                 rv[field][:] = vals[field][mask]
+            if field == "Coordinates":
+                eps = np.finfo(rv[field].dtype).eps
+                for i in range(3):
+                  rv[field][:,i] = np.clip(rv[field][:,i],
+                      self.domain_left_edge[i] + eps,
+                      self.domain_right_edge[i] - eps)
         return rv
 
     def _read_particle_selection(self, chunks, selector, fields):
@@ -421,6 +427,8 @@
         ind = 0
         DLE, DRE = pf.domain_left_edge, pf.domain_right_edge
         dx = (DRE - DLE) / (2**_ORDER_MAX)
+        self.domain_left_edge = DLE
+        self.domain_right_edge = DRE
         with open(data_file.filename, "rb") as f:
             f.seek(pf._header_offset)
             for iptype, ptype in enumerate(self._ptypes):

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