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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Oct 16 16:11:47 PDT 2015


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/721d12a4df8c/
Changeset:   721d12a4df8c
Branch:      yt
User:        jisuoqing
Date:        2015-10-16 19:22:03+00:00
Summary:     Fix unit inconsistancy in spherical lens
Affected #:  1 file

diff -r a1857fbd7d50ee6060bb8e2b0a74ceb6baf118a7 -r 721d12a4df8cd5eafa363ea32cfe09d25929a1e9 yt/visualization/volume_rendering/lens.py
--- a/yt/visualization/volume_rendering/lens.py
+++ b/yt/visualization/volume_rendering/lens.py
@@ -126,6 +126,7 @@
         # Transpose into image coords.
         py = (res[0]*(dx/camera.width[0].d)).astype('int')
         px = (res[1]*(dy/camera.width[1].d)).astype('int')
+        print px, py, 'plane'
         return px, py, dz
 
     def __repr__(self):
@@ -605,7 +606,7 @@
             res = camera.resolution
         # Much of our setup here is the same as in the fisheye, except for the
         # actual conversion back to the px, py values.
-        lpos = camera.position - pos
+        lpos = camera.position.d - pos
         # inv_mat = np.linalg.inv(self.rotation_matrix)
         # lpos = lpos.dot(self.rotation_matrix)
         mag = (lpos * lpos).sum(axis=1)**0.5
@@ -622,11 +623,13 @@
         py = np.arcsin(lpos[:, 2])
         dz = mag / self.radius
         u = camera.focus.uq
+        length_unit = u / u.d
         # dz is distance the ray would travel
         px = ((-px + np.pi) / (2.0*np.pi)) * res[0]
         py = ((-py + np.pi/2.0) / np.pi) * res[1]
-        px = (u * np.rint(px)).astype("int64")
-        py = (u * np.rint(py)).astype("int64")
+        px = (u * np.rint(px) / length_unit).astype("int64")
+        py = (u * np.rint(py) / length_unit).astype("int64")
+        dz = dz * length_unit
         return px, py, dz
 
 


https://bitbucket.org/yt_analysis/yt/commits/d1a550a7fee9/
Changeset:   d1a550a7fee9
Branch:      yt
User:        jisuoqing
Date:        2015-10-16 20:49:19+00:00
Summary:     Fix unit inconsistancy in fisheye lens
Affected #:  1 file

diff -r 721d12a4df8cd5eafa363ea32cfe09d25929a1e9 -r d1a550a7fee991e66e4671962180bc4ff98fabb3 yt/visualization/volume_rendering/lens.py
--- a/yt/visualization/volume_rendering/lens.py
+++ b/yt/visualization/volume_rendering/lens.py
@@ -509,7 +509,7 @@
         # vectors back onto the plane.  arr_fisheye_vectors goes from px, py to
         # vector, and we need the reverse.
         # First, we transform lpos into *relative to the camera* coordinates.
-        lpos = camera.position - pos
+        lpos = camera.position.d - pos
         lpos = lpos.dot(self.rotation_matrix)
         # lpos = lpos.dot(self.rotation_matrix)
         mag = (lpos * lpos).sum(axis=1)**0.5
@@ -522,11 +522,12 @@
         px = r * np.cos(phi)
         py = r * np.sin(phi)
         u = camera.focus.uq
+        length_unit = u / u.d
         # dz is distance the ray would travel
         px = (px + 1.0) * res[0] / 2.0
         py = (py + 1.0) * res[1] / 2.0
-        px = (u * np.rint(px)).astype("int64")
-        py = (u * np.rint(py)).astype("int64")
+        px = (u * np.rint(px) / length_unit).astype("int64")
+        py = (u * np.rint(py) / length_unit).astype("int64")
         return px, py, dz
 
 


https://bitbucket.org/yt_analysis/yt/commits/a18a84a334dd/
Changeset:   a18a84a334dd
Branch:      yt
User:        jisuoqing
Date:        2015-10-16 20:51:01+00:00
Summary:     Add comments
Affected #:  1 file

diff -r d1a550a7fee991e66e4671962180bc4ff98fabb3 -r a18a84a334dd6b039edadfc84f4978ff5ce45922 yt/visualization/volume_rendering/lens.py
--- a/yt/visualization/volume_rendering/lens.py
+++ b/yt/visualization/volume_rendering/lens.py
@@ -526,6 +526,7 @@
         # dz is distance the ray would travel
         px = (px + 1.0) * res[0] / 2.0
         py = (py + 1.0) * res[1] / 2.0
+        # px and py should be dimensionless
         px = (u * np.rint(px) / length_unit).astype("int64")
         py = (u * np.rint(py) / length_unit).astype("int64")
         return px, py, dz
@@ -628,9 +629,9 @@
         # dz is distance the ray would travel
         px = ((-px + np.pi) / (2.0*np.pi)) * res[0]
         py = ((-py + np.pi/2.0) / np.pi) * res[1]
+        # px and py should be dimensionless
         px = (u * np.rint(px) / length_unit).astype("int64")
         py = (u * np.rint(py) / length_unit).astype("int64")
-        dz = dz * length_unit
         return px, py, dz
 
 


https://bitbucket.org/yt_analysis/yt/commits/41093a43e761/
Changeset:   41093a43e761
Branch:      yt
User:        jisuoqing
Date:        2015-10-16 20:53:35+00:00
Summary:     Delete tmp print code
Affected #:  1 file

diff -r a18a84a334dd6b039edadfc84f4978ff5ce45922 -r 41093a43e76106371d9ce7d30dbc1e98f4ffd60b yt/visualization/volume_rendering/lens.py
--- a/yt/visualization/volume_rendering/lens.py
+++ b/yt/visualization/volume_rendering/lens.py
@@ -126,7 +126,6 @@
         # Transpose into image coords.
         py = (res[0]*(dx/camera.width[0].d)).astype('int')
         px = (res[1]*(dy/camera.width[1].d)).astype('int')
-        print px, py, 'plane'
         return px, py, dz
 
     def __repr__(self):


https://bitbucket.org/yt_analysis/yt/commits/7880f2ac44ac/
Changeset:   7880f2ac44ac
Branch:      yt
User:        chummels
Date:        2015-10-16 23:11:40+00:00
Summary:     Merged in jisuoqing/yt (pull request #1813)

[experimental] [bugfix] Fix unit inconsistance in project_to_plane for fisheye and spherical lenses
Affected #:  1 file

diff -r 6facab7ff3258b232346caaecd999be9f25ef139 -r 7880f2ac44ac6134cb5bdf614fd5ec26e9f25336 yt/visualization/volume_rendering/lens.py
--- a/yt/visualization/volume_rendering/lens.py
+++ b/yt/visualization/volume_rendering/lens.py
@@ -513,7 +513,7 @@
         # vectors back onto the plane.  arr_fisheye_vectors goes from px, py to
         # vector, and we need the reverse.
         # First, we transform lpos into *relative to the camera* coordinates.
-        lpos = camera.position - pos
+        lpos = camera.position.d - pos
         lpos = lpos.dot(self.rotation_matrix)
         # lpos = lpos.dot(self.rotation_matrix)
         mag = (lpos * lpos).sum(axis=1)**0.5
@@ -526,11 +526,13 @@
         px = r * np.cos(phi)
         py = r * np.sin(phi)
         u = camera.focus.uq
+        length_unit = u / u.d
         # dz is distance the ray would travel
         px = (px + 1.0) * res[0] / 2.0
         py = (py + 1.0) * res[1] / 2.0
-        px = (u * np.rint(px)).astype("int64")
-        py = (u * np.rint(py)).astype("int64")
+        # px and py should be dimensionless
+        px = (u * np.rint(px) / length_unit).astype("int64")
+        py = (u * np.rint(py) / length_unit).astype("int64")
         return px, py, dz
 
 
@@ -610,7 +612,7 @@
             res = camera.resolution
         # Much of our setup here is the same as in the fisheye, except for the
         # actual conversion back to the px, py values.
-        lpos = camera.position - pos
+        lpos = camera.position.d - pos
         # inv_mat = np.linalg.inv(self.rotation_matrix)
         # lpos = lpos.dot(self.rotation_matrix)
         mag = (lpos * lpos).sum(axis=1)**0.5
@@ -627,11 +629,13 @@
         py = np.arcsin(lpos[:, 2])
         dz = mag / self.radius
         u = camera.focus.uq
+        length_unit = u / u.d
         # dz is distance the ray would travel
         px = ((-px + np.pi) / (2.0*np.pi)) * res[0]
         py = ((-py + np.pi/2.0) / np.pi) * res[1]
-        px = (u * np.rint(px)).astype("int64")
-        py = (u * np.rint(py)).astype("int64")
+        # px and py should be dimensionless
+        px = (u * np.rint(px) / length_unit).astype("int64")
+        py = (u * np.rint(py) / length_unit).astype("int64")
         return px, py, dz

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