artist.geometry.transforms ========================== .. py:module:: artist.geometry.transforms Functions --------- .. autoapisummary:: artist.geometry.transforms.rotate_distortions artist.geometry.transforms.rotate_e artist.geometry.transforms.rotate_n artist.geometry.transforms.rotate_u artist.geometry.transforms.translate_enu artist.geometry.transforms.perform_canting Module Contents --------------- .. py:function:: rotate_distortions(e: torch.Tensor, u: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Rotate the distortions for the light source. Rotate around the up and then the east axis in this very order in a right-handed east-north-up coordinate system. Positive angles result in a rotation in the mathematical direction of rotation, i.e., counter-clockwise. Points need to be multiplied as column vectors from the right-hand side with the resulting rotation matrix. Note that the order is fixed due to the non-commutative property of matrix-matrix multiplication. Parameters ---------- e : torch.Tensor East rotation angles in radians. Shape is ``[number_of_heliostats, number_of_rays, number_of_surface_points]``. u : torch.Tensor Up rotation angles in radians. Shape is ``[number_of_heliostats, number_of_rays, number_of_surface_points]``. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Raises ------ ValueError If the shapes of the input tensors do not match. Returns ------- torch.Tensor Batched 4×4 rotation matrices, one per distortion sample. Shape is ``[number_of_heliostats, number_of_rays, number_of_surface_points, 4, 4]``. .. py:function:: rotate_e(e: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Rotate around the east axis. Rotate around the east axis in a right-handed east-north-up coordinate system. Positive angles result in a rotation in the mathematical direction of rotation, i.e., counter-clockwise. Points need to be multiplied as column vectors from the right-hand side with the resulting rotation matrix. Parameters ---------- e : torch.Tensor East rotation angles in radians. Shape is ``[number_of_heliostats]``. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor Batched 4×4 east-axis rotation matrices, one per heliostat. Shape is ``[number_of_heliostats, 4, 4]``. .. py:function:: rotate_n(n: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Rotate around the north axis. Rotate around the north axis in a right-handed east-north-up coordinate system. Positive angles result in a rotation in the mathematical direction of rotation, i.e., counter-clockwise. Points need to be multiplied as column vectors from the right-hand side with the resulting rotation matrix. Parameters ---------- n : torch.Tensor North rotation angles in radians. Shape is ``[number_of_heliostats]``. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor Batched 4×4 north-axis rotation matrices, one per heliostat. Shape is ``[number_of_heliostats, 4, 4]``. .. py:function:: rotate_u(u: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Rotate around the up axis. Rotate around the up axis in a right-handed east-north-up coordinate system. Positive angles result in a rotation in the mathematical direction of rotation, i.e., counter-clockwise. Points need to be multiplied as column vectors from the right-hand side with the resulting rotation matrix. Parameters ---------- u : torch.Tensor Up rotation angles in radians. Shape is ``[number_of_heliostats]``. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor Batched 4×4 up-axis rotation matrices, one per heliostat. Shape is ``[number_of_heliostats, 4, 4]``. .. py:function:: translate_enu(e: torch.Tensor, n: torch.Tensor, u: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Translate in all directions. Translate a given point in the east, north, and up direction. Note that the point must be multiplied as a column vector from the right-hand side of the resulting matrix. Parameters ---------- e : torch.Tensor East translation distances in meters. Shape is ``[number_of_heliostats]``. n : torch.Tensor North translation distances in meters. Shape is ``[number_of_heliostats]``. u : torch.Tensor Up translation distances in meters. Shape is ``[number_of_heliostats]``. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Raises ------ ValueError If the sizes of the input tensors do not match. Returns ------- torch.Tensor Batched 4×4 translation matrices, one per heliostat. Shape is ``[number_of_heliostats, 4, 4]``. .. py:function:: perform_canting(canting_angles: torch.Tensor, data: torch.Tensor, inverse: bool = False, device: torch.device | None = None) -> torch.Tensor Perform canting (rotation) on data like surface points or surface normals. Parameters ---------- canting_angles : torch.Tensor Canting angles. Shape is ``[number_of_surfaces, number_of_facets, 2, 4]``. data : torch.Tensor Data to be canted. Shape is ``[number_of_surfaces, number_of_facets, number_of_points_per_facet, 4]``. inverse : bool Indicates the direction of the rotation. Use ``inverse=False`` for canting and ``inverse=True`` for decanting (default is False). device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor The (de-)canted data. Shape is ``[number_of_surfaces, number_of_facets, number_of_points_per_facet, 4]``.