xmcd_projection.projection

xmcd_projection.projection.get_projection_vector(phi, theta)

Gets the projection vector based on the phi angle in xy plane and theta inclination angle to the xy plane (spherical polars)

Parameters
  • phi (float) – Phi angle in degrees.

  • theta (float) – Theta angle in degrees.

Returns

Projection vector.

Return type

(3,) array

xmcd_projection.projection.project_points(pts, p, n=[0, 0, 1], x0=[0, 0, 0])

Projects the points along a vector p to a surface with normal n going through point x0

xmcd_projection.projection.project_structure(struct, p, n=[0, 0, 1], x0=None)

Projects the structure along a vector p to the plane with normal n containing the point x0. If x0 is None, take the structure point closest to the plane along p. Returns a trimesh structure.

Parameters
  • struct (object) – Any object containing property vertices which is (n,3) array

  • p ((3,) array) – Projection direction.

  • n ((3,) array, optional) – Normal to the surface. Defaults to [0, 0, 1].

  • x0 ((3,), optional) – Point on the surface. Defaults to None.

Returns

Same as struct with vertices being the projected points.

Return type

object