[yt-svn] commit/yt: xarthisius: Merged in atmyers/yt (pull request #1970)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Feb 3 09:32:27 PST 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/f45bbeea6df8/
Changeset:   f45bbeea6df8
Branch:      yt
User:        xarthisius
Date:        2016-02-03 17:32:20+00:00
Summary:     Merged in atmyers/yt (pull request #1970)

[BUGFIX] Correcting orientation of MeshSource renderings.
Affected #:  2 files

diff -r b75596b39ea8aeb671251a116ce828d8c74c1f88 -r f45bbeea6df80d9b1080479fe203d56db19f51de doc/source/visualizing/unstructured_mesh_rendering.rst
--- a/doc/source/visualizing/unstructured_mesh_rendering.rst
+++ b/doc/source/visualizing/unstructured_mesh_rendering.rst
@@ -114,7 +114,7 @@
     cam = sc.camera
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam_pos = ds.arr([-3.0, 3.0, -3.0], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.set_position(cam_pos, north_vector)
 
     # increase the default resolution
@@ -142,7 +142,7 @@
     cam = sc.camera
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam_pos = ds.arr([-3.0, 3.0, -3.0], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.set_position(cam_pos, north_vector)
 
     # increase the default resolution
@@ -174,7 +174,7 @@
     cam = sc.camera
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam_pos = ds.arr([-3.0, 3.0, -3.0], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.set_position(cam_pos, north_vector)
    
     # increase the default resolution
@@ -205,7 +205,7 @@
     cam = sc.camera
     camera_position = ds.arr([3.0, 3.0, 3.0], 'code_length')
     cam.set_width(ds.arr([2.0, 2.0, 2.0], 'code_length'))
-    north_vector = ds.arr([0.0, 1.0, 0.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, 0.0], 'dimensionless')
     cam.set_position(camera_position, north_vector)
 
     # increase the default resolution
@@ -236,7 +236,7 @@
     # adjust the camera position and orientation
     cam = sc.camera
     camera_position = ds.arr([-1.0, 1.0, -0.5], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.width = ds.arr([0.04, 0.04, 0.04], 'code_length')
     cam.set_position(camera_position, north_vector)
 
@@ -307,7 +307,7 @@
     cam = Camera(ds, lens_type='perspective')
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam_pos = ds.arr([-4.5, 4.5, -4.5], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.set_position(cam_pos, north_vector)
    
     # tell our scene to use it
@@ -340,7 +340,7 @@
     cam = Camera(ds)
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam.set_position(ds.arr([-3.0, 3.0, -3.0], 'code_length'),
-    ds.arr([0.0, 1.0, 0.0], 'dimensionless'))
+                     ds.arr([0.0, -1.0, 0.0], 'dimensionless'))
     cam.set_width = ds.arr([8.0, 8.0, 8.0], 'code_length')
     cam.resolution = (800, 800)
 
@@ -385,7 +385,7 @@
     cam = sc.camera
     cam.focus = ds.arr([0.0, 0.0, 0.0], 'code_length')
     cam_pos = ds.arr([-3.0, 3.0, -3.0], 'code_length')
-    north_vector = ds.arr([0.0, 1.0, 1.0], 'dimensionless')
+    north_vector = ds.arr([0.0, -1.0, -1.0], 'dimensionless')
     cam.set_position(cam_pos, north_vector)
 
     # increase the default resolution
@@ -435,7 +435,7 @@
 	cam = Camera(ds)
 	camera_position = ds.arr([0.1, 0.0, 0.1], 'code_length')
 	cam.focus = ds.domain_center
-	north_vector = ds.arr([0.3032476, 0.71782557, -0.62671153], 'dimensionless')
+	north_vector = ds.arr([-0.3032476, -0.71782557, 0.62671153], 'dimensionless')
 	cam.width = ds.arr([ 0.04,  0.04,  0.04], 'code_length')
 	cam.resolution = (800, 800)
 	cam.set_position(camera_position, north_vector)

diff -r b75596b39ea8aeb671251a116ce828d8c74c1f88 -r f45bbeea6df80d9b1080479fe203d56db19f51de yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -487,7 +487,7 @@
         self.sampler(self.scene)
         mylog.debug("Done casting rays")
 
-        self.finalize_image(camera, self.sampler.aimage)
+        self.finalize_image(camera)
         self.data = self.sampler.aimage
         self.current_image = self.apply_colormap()
 
@@ -503,8 +503,10 @@
 
         return self.current_image
 
-    def finalize_image(self, camera, image):
+    def finalize_image(self, camera):
         sam = self.sampler
+
+        # reshape data
         Nx = camera.resolution[0]
         Ny = camera.resolution[1]
         sam.aimage = sam.aimage.reshape(Nx, Ny)
@@ -512,6 +514,12 @@
         sam.mesh_lines = sam.mesh_lines.reshape(Nx, Ny)
         sam.zbuffer = sam.zbuffer.reshape(Nx, Ny)
 
+        # rotate
+        sam.aimage = np.rot90(sam.aimage, k=2)
+        sam.image_used = np.rot90(sam.image_used, k=2)
+        sam.mesh_lines = np.rot90(sam.mesh_lines, k=2)
+        sam.zbuffer = np.rot90(sam.zbuffer, k=2)
+
     def annotate_mesh_lines(self, color=None, alpha=1.0):
         r"""

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