aidapy.tools.vdf_utils module

aidapy.tools.vdf_utils.R_2vect(vector_orig, vector_fin)[source]

Taken from: https://github.com/Wallacoloo/printipi/blob/master/util/rotation_matrix.py Calculate the rotation matrix required to rotate from one vector to another. For the rotation of one vector to another, there are an infinit series of rotation matrices possible. Due to axially symmetry, the rotation axis can be any vector lying in the symmetry plane between the two vectors. Hence the axis-angle convention will be used to construct the matrix with the rotation axis defined as the cross product of the two vectors. The rotation angle is the arccosine of the dot product of the two unit vectors. Given a unit vector parallel to the rotation axis, w = [x, y, z] and the rotation angle a, the rotation matrix R is:

      |  1 + (1-cos(a))*(x*x-1)   -z*sin(a)+(1-cos(a))*x*y   y*sin(a)+(1-cos(a))*x*z |
R  =  |  z*sin(a)+(1-cos(a))*x*y   1 + (1-cos(a))*(y*y-1)   -x*sin(a)+(1-cos(a))*y*z |
      | -y*sin(a)+(1-cos(a))*x*z   x*sin(a)+(1-cos(a))*y*z   1 + (1-cos(a))*(z*z-1)  |
Parameters
  • R – The 3x3 rotation matrix to update.

  • vector_orig – The unrotated vector defined in the reference frame.

  • vector_fin – The rotated vector defined in the reference frame.

aidapy.tools.vdf_utils.Rx(a, theta)[source]

Rotation around the x-axis of angle theta.

aidapy.tools.vdf_utils.Ry(a, phi)[source]

Rotation around the y-axis of angle phi.

aidapy.tools.vdf_utils.Rz(a, psi)[source]

Rotation around the z-axis of angle psi.

aidapy.tools.vdf_utils.cart2cyl(v_cart)[source]

Coordinate system conversion

aidapy.tools.vdf_utils.cart2spher(v_cart)[source]

Coordinate system conversion

aidapy.tools.vdf_utils.cyl2cart(v_cyl)[source]

Coordinate system conversion

aidapy.tools.vdf_utils.init_grid(v_max, resolution, grid_geom)[source]

Here we define the bin edges and centers, depending on the chosen coordinate system.

aidapy.tools.vdf_utils.spher2cart(v_spher)[source]

Coordinate system conversion

class aidapy.tools.vdf_utils.vdf(v_max, resolution, grid_geom)[source]

Bases: object

docstring

interpolate_cart_vdf(grid, vdf0, interpolate='near')[source]

docstring

interpolate_spher_vdf(grid, vdf0, interpolate='near')[source]

docstring

transform_grid(R=None, v=None, s=None)[source]

docstring

aidapy.tools.vdf_utils.vdf_scaled(vdf)[source]

0-to-1 scaling of a vdf. Must be given over a spherical grid.