[yt-dev] Orientation vectors

Nathan Goldbaum nathan12343 at gmail.com
Wed Aug 22 08:21:34 PDT 2012


Hey John,

I think the issue is that yt uses a left-handed coordinate system 
internally.  This particular choice makes it so that if you create a 
volume rendering, off axis slice plot, or off axis projection it is 
oriented in the same way as a regular slice or projection.  Of course if 
you don't like that convention you can always specify a north_vector.

If you want to transform to your sky coordinate frame you will need to 
come up with a more general transformation matrix rather than 
multiplying by x, y, and z scalars (i.e. a diagonal transformation 
matrix).  Fortunately the orientation class already does the hard work 
for you, I think all you need to do is multiply the (x,y,z) vector by 
the orientation.unit_vectors matrix (maybe orientation.inv_matrix, 
sorry, this 3D geometry stuff always confuses me ;)

Hope that helps.

Nathan

On 8/22/12 10:23 PM, John ZuHone wrote:
> Hi all, and specifically to those of you with experience with the Orientation vectors...
>
> Doing some testing, I set up an orienter like this:
>
> orient = Orientation([0.0,0.0,1.0])
>
> and the output of orient.unit_vectors is:
>
> [array([ 0., -1.,  0.]), array([ 1.,  0., -0.]), array([ 0.,  0.,  1.])]
>
> which I would have expected
>
> [array([ 1., 0.,  0.]), array([ 0.,  1., 0.]), array([ 0.,  0.,  1.])]
>
> although I know I could fix this by specifying a north_vector, why would the latter not be the default?
>
> I'm asking because I was attempting to set up new coordinates like so:
>
> orient = Orientation(L)
>
> x_hat = orient.unit_vectors[0]
> y_hat = orient.unit_vectors[1]
> z_hat = orient.unit_vectors[2]
>          
> xsky = x*x_hat[0] + y*x_hat[1] + z*x_hat[2]
> ysky = x*y_hat[0] + y*y_hat[1] + z*y_hat[2]
> zsky = x*z_hat[0] + y*z_hat[1] + z*z_hat[2]
>
> but this will rotate the x,y plane by 90 degrees.
>
> Best,
>
> John
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org




More information about the yt-dev mailing list