[yt-dev] Orientation vectors

John ZuHone jzuhone at gmail.com
Wed Aug 22 08:40:17 PDT 2012


Hi Nathan,

Thanks for this information, it is very helpful. In any case I can look at the way north_vector is being computed and try to compute that in a right-handed way. 

I think that multiplying by that matrix is what my earlier email showed:

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]

Best,

John

On Aug 22, 2012, at 11:21 AM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:

> 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
> 
> _______________________________________________
> 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