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
Hey John, I think the issue is that yt uses a lefthanded 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 _______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
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 righthanded 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@gmail.com> wrote:
Hey John,
I think the issue is that yt uses a lefthanded 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 _______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
_______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
Hi Nathan, Do you have a reference for the calculation of the north and east vectors? John On Aug 22, 2012, at 11:21 AM, Nathan Goldbaum wrote:
Hey John,
I think the issue is that yt uses a lefthanded 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 _______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
_______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
Hi John, If you mean a reference to a paper or something like that, no. Given a normal vector, it first generates an east vector by taking the cross product between the normal vector and the axis vector that makes the largest angle with the normal vector. It then generates a north vector by taking the cross product between the east vector and north vector. Since there are an infinite number of possible bases given a single normal vector, I decided to choose the preferred basis based on the orientation of the simulation box. This isn't necessarily the cleanest approach and it may very well be that there are better solutions. Cheers, Nathan On 8/23/12 12:50 AM, John ZuHone wrote:
Hi Nathan,
Do you have a reference for the calculation of the north and east vectors?
John
On Aug 22, 2012, at 11:21 AM, Nathan Goldbaum wrote:
Hey John,
I think the issue is that yt uses a lefthanded 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 _______________________________________________ ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
ytdev mailing list ytdev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytdevspacepope.org
participants (2)

John ZuHone

Nathan Goldbaum