get_rotation_from_z_to_direction#

diffsims.generators.zap_map_generator.get_rotation_from_z_to_direction(structure, direction)[source]#

Finds the rotation that takes [001] to a given zone axis.

Parameters:
  • structure (diffpy.structure.structure.Structure) – The structure for which a rotation needs to be found.

  • direction (array like) – [UVW] direction that the ‘z’ axis should end up point down.

Returns:

euler_angles – ‘rzxz’ in degrees.

Return type:

tuple

Notes

This implementation works with an axis arrangement that has +x as left to right, +y as bottom to top and +z as out of the plane of a page. Rotations are counter clockwise as you look from the tip of the axis towards the origin