artist.field ============ .. py:module:: artist.field .. autoapi-nested-parse:: Bundle all classes that represent physical objects in ``ARTIST``. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/artist/field/actuators/index /autoapi/artist/field/actuators_ideal/index /autoapi/artist/field/actuators_linear/index /autoapi/artist/field/heliostat_field/index /autoapi/artist/field/heliostat_group/index /autoapi/artist/field/heliostat_group_rigid_body/index /autoapi/artist/field/kinematic/index /autoapi/artist/field/kinematic_rigid_body/index /autoapi/artist/field/surface/index /autoapi/artist/field/tower_target_areas/index Classes ------- .. autoapisummary:: artist.field.Actuators artist.field.IdealActuators artist.field.LinearActuators artist.field.HeliostatField artist.field.HeliostatGroup artist.field.HeliostatGroupRigidBody artist.field.Kinematic artist.field.RigidBody artist.field.Surface artist.field.TowerTargetAreas Package Contents ---------------- .. py:class:: Actuators(non_optimizable_parameters: torch.Tensor, optimizable_parameters: torch.Tensor = torch.tensor([], requires_grad=True), device: torch.device | None = None) Bases: :py:obj:`torch.nn.Module` Initialize abstract actuators. The abstract actuator implements a template for the construction of inheriting actuators. An actuator is responsible for turning the heliostat surface in such a way that the heliostat reflects the incoming light onto the aim point on the tower. The abstract actuator specifies the functionality that must be implemented in the inheriting classes. These include one function to map the motor steps to angles and another one for the opposite conversion of angles to motor steps. Parameters ---------- non_optimizable_parameters : torch.Tensor The non-optimizable actuator parameters, describing actuator geometry. Tensor of shape [number_of_heliostats, 7, 2] for linear actuators or [number_of_heliostats, 4, 2] for ideal actuators. optimizable_parameters : torch.Tensor The two optimizable actuator parameters, describing the initial actuator configuration. Tensor of shape [number_of_heliostats, 2, 2] for linear actuators or [] for ideal actuators (default is torch.Tensor([])). 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. .. py:attribute:: non_optimizable_parameters .. py:attribute:: optimizable_parameters .. py:attribute:: active_non_optimizable_parameters .. py:attribute:: active_optimizable_parameters .. py:method:: motor_positions_to_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor :abstractmethod: Calculate the joint angles for given motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 ------ NotImplementedError This abstract method must be overridden. .. py:method:: angles_to_motor_positions(angles: torch.Tensor, device: torch.device | None = None) -> torch.Tensor :abstractmethod: Calculate the motor positions for given joint angles. Parameters ---------- angles : torch.Tensor The joint angles. Tensor of shape [number_of_active_heliostats, 2]. 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 ------ NotImplementedError This abstract method must be overridden. .. py:method:: forward(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Specify the forward operation of the actuator, i.e., calculate the angles for given the motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions to be converted to joint angles. Tensor of shape [number_of_active_heliostats, 2]. 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 joint angles. Tensor of shape [number_of_active_heliostats, 2]. .. py:class:: IdealActuators(non_optimizable_parameters: torch.Tensor, optimizable_parameters: torch.Tensor = torch.tensor([], requires_grad=True), device: torch.device | None = None) Bases: :py:obj:`artist.field.actuators.Actuators` Initialize ideal actuators. Parameters ---------- non_optimizable_parameters : torch.Tensor The four non-optimizable actuator parameters, describing actuator geometry. Tensor of shape [number_of_heliostats, 4, 2]. optimizable_parameters : torch.Tensor The ideal actuators do not have optimizable parameters, this tensor is therefore empty (default is torch.tensor([])). Tensor of shape []. 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. .. py:method:: motor_positions_to_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the joint angles for given motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 joint angles corresponding to the motor positions. .. py:method:: angles_to_motor_positions(angles: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the motor positions for given joint angles. Parameters ---------- angles : torch.Tensor The joint angles. Tensor of shape [number_of_active_heliostats, 2]. 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 motor steps. Tensor of shape [number_of_active_heliostats, 2]. .. py:class:: LinearActuators(non_optimizable_parameters: torch.Tensor, optimizable_parameters: torch.Tensor = torch.tensor([], requires_grad=True), device: torch.device | None = None) Bases: :py:obj:`artist.field.actuators.Actuators` Initialize linear actuators. A linear actuator describes movement within a 2D plane. One linear actuator has seven non optimizable parameters, that describe the geometry. Ordered by index, the first parameter describes the type of the actuator, i.e., linear, the second parameter describes the turning direction of the actuator. The third and fourth parameters are the minimum and maximum motor positions. The next five parameters are the increment, which stores the information about the stroke length change per motor step, an offset that describes the difference between the linear actuator's pivoting point and the point around which the actuator is allowed to pivot, and the actuator's pivot radius. A linear actuator also has two optimizable parameters, namely the initial angle which indicates the angle that the actuator introduces to the manipulated coordinate system at the initial stroke length, which is the second parameter. Parameters ---------- non_optimizable_parameters : torch.Tensor The seven non-optimizable actuator parameters, describing actuator geometry. Tensor of shape [number_of_heliostats, 7, 2]. optimizable_parameters : torch.Tensor The two optimizable actuator parameters, describing the initial actuator configuration. Tensor of shape [number_of_heliostats, 2, 2]. 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. .. py:attribute:: epsilon :value: 1e-06 .. py:method:: _physics_informed_parameters(device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Limit actuator parameters to their physically valid ranges. The four parameters: types, turning directions, min and max increments are not optimizable and do not need to be physics informed. The parameters increment, initial stroke lengths, offsets and pivot radii are defined to be strictly positive. Parameters ---------- 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 physics-informed optimizable parameters. Tensor of shape [number_of_active_heliostats, 7, 2]. torch.Tensor The physics-informed non-optimizable parameters. Tensor of shape [number_of_active_heliostats, 2, 2]. .. py:method:: _motor_positions_to_absolute_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Convert motor steps into angles using actuator geometries. Calculate absolute angles based solely on the motors' current positions and the geometries of the actuators. This gives the angles of the actuators in a global sense. It does not consider the starting positions of the motors. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 calculated absolute angles. Tensor of shape [number_of_active_heliostats, 2]. .. py:method:: motor_positions_to_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the joint angles for given motor positions. The absolute angles are adjusted to be relative to the initial angles. This accounts for the initial angles and the motors' directions (clockwise or counterclockwise). Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 joint angles corresponding to the motor positions. Tensor of shape [number_of_active_heliostats, 2]. .. py:method:: angles_to_motor_positions(angles: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the motor positions for given joint angles. First the relative angular changes are calculated based on the given angles. Then the corresponding stroke lengths are determined using trigonometric relationships. These stroke lengths are converted into motor steps. Parameters ---------- angles : torch.Tensor The joint angles. Tensor of shape [number_of_active_heliostats, 2]. 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 motor steps. Tensor of shape [number_of_active_heliostats, 2]. .. py:class:: HeliostatField(heliostat_groups: collections.abc.Sequence[artist.field.heliostat_group.HeliostatGroup], device: torch.device | None = None) Initialize the heliostat field with heliostat groups. Parameters ---------- heliostat_groups : Sequence[HeliostatGroup] A list containing all heliostat groups. device : 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. .. py:attribute:: heliostat_groups .. py:attribute:: number_of_heliostat_groups .. py:attribute:: number_of_heliostats_per_group .. py:method:: from_hdf5(config_file: h5py.File, prototype_surface: artist.scenario.configuration_classes.SurfaceConfig, prototype_kinematic: dict[str, str | torch.Tensor], prototype_actuators: dict[str, str | torch.Tensor], number_of_surface_points_per_facet: torch.Tensor, change_number_of_control_points_per_facet: torch.Tensor | None = None, device: torch.device | None = None) -> typing_extensions.Self :classmethod: Load a heliostat field from an HDF5 file. Parameters ---------- config_file : h5py.File The HDF5 file containing the configuration to be loaded. prototype_surface : SurfaceConfig The prototype for the surface configuration to be used if a heliostat has no individual surface. prototype_kinematic : dict[str, str | torch.Tensor] The prototype for the kinematic, including type, initial orientation and deviations. prototype_actuators : dict[str, str | torch.Tensor] The prototype for the actuators, including type and parameters. number_of_surface_points_per_facet : torch.Tensor The number of sampling points along each direction of each 2D facet. Tensor of shape [2]. change_number_of_control_points_per_facet : torch.Tensor | None The updated number of control points along each direction of each 2D facet (default is None). Providing this parameter should be done with caution. In a scenario with surfaces generated by deflectometry, this parameter should be None, otherwise the deflectometry surface will be overwritten and become ideal. For ideal surfaces this parameter can be used to change the number of control points specified in the .h5 scenario. Tensor of shape [2]. device : 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 neither prototypes nor individual heliostat parameters are provided. Returns ------- HeliostatField The heliostat field loaded from the HDF5 file. .. py:class:: HeliostatGroup(names: list[str], positions: torch.Tensor, surface_points: torch.Tensor, surface_normals: torch.Tensor, initial_orientations: torch.Tensor, nurbs_control_points: torch.Tensor, nurbs_degrees: torch.Tensor, device: torch.device | None = None) Initialize the heliostat group. Parameters ---------- names : list[str] The string names of each heliostat in the group in order. positions : torch.Tensor The positions of all heliostats in the group. Tensor of shape [number_of_heliostats, 4]. surface_points : torch.Tensor The surface points of all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_combined_surface_points_all_facets, 4]. surface_normals : torch.Tensor The surface normals of all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_combined_surface_normals_all_facets, 4]. initial_orientations : torch.Tensor The initial orientations of all heliostats in the group. Tensor of shape [number_of_heliostats, 4]. nurbs_control_points : torch.Tensor The control points for NURBS surfaces for all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_facets_per_heliostat, number_of_control_points_u_direction, number_of_control_points_v_direction 3]. nurbs_degrees : torch.Tensor The spline degrees for NURBS surfaces in u and then in v direction, for all heliostats in the group. Tensor of shape [2]. 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. .. py:attribute:: number_of_heliostats .. py:attribute:: number_of_facets_per_heliostat .. py:attribute:: names .. py:attribute:: positions .. py:attribute:: surface_points .. py:attribute:: surface_normals .. py:attribute:: initial_orientations .. py:attribute:: nurbs_control_points .. py:attribute:: nurbs_degrees .. py:attribute:: kinematic .. py:attribute:: number_of_active_heliostats :value: 0 .. py:attribute:: active_heliostats_mask .. py:attribute:: active_surface_points .. py:attribute:: active_surface_normals .. py:attribute:: active_nurbs_control_points .. py:attribute:: preferred_reflection_directions .. py:method:: align_surfaces_with_incident_ray_directions(aim_points: torch.Tensor, incident_ray_directions: torch.Tensor, active_heliostats_mask: torch.Tensor, device: torch.device | None = None) -> None :abstractmethod: Align surface points and surface normals with incident ray directions. Parameters ---------- aim_points : torch.Tensor The aim points for all active heliostats. Tensor of shape [number_of_active_heliostats, 4]. incident_ray_directions : torch.Tensor The incident ray directions. Tensor of shape [number_of_active_heliostats, 4]. active_heliostats_mask : torch.Tensor A mask where 0 indicates a deactivated heliostat and 1 an activated one. An integer greater than 1 indicates that this heliostat is regarded multiple times. Tensor of shape [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 ------ NotImplementedError Whenever called (abstract base class method). .. py:method:: align_surfaces_with_motor_positions(motor_positions: torch.Tensor, active_heliostats_mask: torch.Tensor, device: torch.device | None = None) -> None :abstractmethod: Align surface points and surface normals with motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions for all active heliostats. Tensor of shape [number_of_active_heliostats, 2]. active_heliostats_mask : torch.Tensor A mask where 0 indicates a deactivated heliostat and 1 an activated one. An integer greater than 1 indicates that this heliostat is regarded multiple times. Tensor of shape [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 ------ NotImplementedError Whenever called (abstract base class method). .. py:method:: activate_heliostats(active_heliostats_mask: torch.Tensor | None = None, device: torch.device | None = None) -> None Activate certain heliostats for alignment, raytracing or optimization. Select and repeat indices of all active heliostat and kinematic parameters once according to the mask. Doing this once instead of slicing every time when accessing one of those parameter tensors saves memory. Parameters ---------- active_heliostats_mask : torch.Tensor | None A mask where 0 indicates a deactivated heliostat and 1 an activated one (default is None). An integer greater than 1 indicates that this heliostat is regarded multiple times. If no mask is provided, all heliostats in the scenario will be activated once. Tensor of shape [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. .. py:class:: HeliostatGroupRigidBody(names: list[str], positions: torch.Tensor, surface_points: torch.Tensor, surface_normals: torch.Tensor, initial_orientations: torch.Tensor, nurbs_control_points: torch.Tensor, nurbs_degrees: torch.Tensor, kinematic_translation_deviation_parameters: torch.Tensor, kinematic_rotation_deviation_parameters: torch.Tensor, actuator_parameters_non_optimizable: torch.Tensor, actuator_parameters_optimizable: torch.Tensor = torch.tensor([]), device: torch.device | None = None) Bases: :py:obj:`artist.field.heliostat_group.HeliostatGroup` Initialize a heliostat group with a rigid body kinematic and linear or ideal actuator type. Parameters ---------- names : list[str] The string names of each heliostat in the group in order. positions : torch.Tensor The positions of all heliostats in the group. Tensor of shape [number_of_heliostats, 4]. surface_points : torch.Tensor The surface points of all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_combined_surface_points_all_facets, 4]. surface_normals : torch.Tensor The surface normals of all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_combined_surface_normals_all_facets, 4]. initial_orientations : torch.Tensor The initial orientations of all heliostats in the group. Tensor of shape [number_of_heliostats, 4]. nurbs_control_points : torch.Tensor The control points for NURBS surfaces for all heliostats in the group. Tensor of shape [number_of_heliostats, number_of_facets_per_heliostat, number_of_control_points_u_direction, number_of_control_points_v_direction 3]. nurbs_degrees : torch.Tensor The spline degrees for NURBS surfaces in u and then in v direction, for all heliostats in the group. Tensor of shape [2]. kinematic_translation_deviation_parameters : torch.Tensor The kinematic translation deviation parameters of all heliostats in the group. Tensor of shape [number_of_heliostats, 9]. kinematic_rotation_deviation_parameters : torch.Tensor The kinematic rotation deviation parameters of all heliostats in the group. Tensor of shape [number_of_heliostats, 4]. actuator_parameters_non_optimizable : torch.Tensor The non-optimizable actuator parameters. Tensor of shape [number_of_heliostats, 7, 2] for linear actuators or [number_of_heliostats, 4, 2] for ideal actuators. actuator_parameters_optimizable : torch.Tensor The optimizable actuator parameters. Tensor of shape [number_of_heliostats, 2, 2] for linear actuators or [] for ideal actuators (default is torch.tensor([])). 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. .. py:attribute:: kinematic .. py:method:: align_surfaces_with_incident_ray_directions(aim_points: torch.Tensor, incident_ray_directions: torch.Tensor, active_heliostats_mask: torch.Tensor, device: torch.device | None = None) -> None Align surface points and surface normals with incident ray directions. This method uses incident ray directions to align the heliostats. It is possible to have different incident ray directions for different heliostats, for example during calibration tasks. Only active heliostats can be aligned. Parameters ---------- aim_points : torch.Tensor The aim points for all active heliostats. Tensor of shape [number_of_active_heliostats, 4]. incident_ray_directions : torch.Tensor The incident ray directions. Tensor of shape [number_of_active_heliostats, 4]. active_heliostats_mask : torch.Tensor A mask where 0 indicates a deactivated heliostat and 1 an activated one. An integer greater than 1 indicates that this heliostat is regarded multiple times. Tensor of shape [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 not all heliostats trying to be aligned have been activated. .. py:method:: align_surfaces_with_motor_positions(motor_positions: torch.Tensor, active_heliostats_mask: torch.Tensor, device: torch.device | None = None) -> None Align surface points and surface normals with motor positions. Only active heliostats can be aligned. Parameters ---------- motor_positions : torch.Tensor The motor positions for all active heliostats. Tensor of shape [number_of_active_heliostats, 2]. active_heliostats_mask : torch.Tensor A mask where 0 indicates a deactivated heliostat and 1 an activated one. An integer greater than 1 indicates that this heliostat is regarded multiple times. Tensor of shape [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 not all heliostats trying to be aligned have been activated. .. py:class:: Kinematic Bases: :py:obj:`torch.nn.Module` Initialize the kinematic. The abstract kinematic implements a template for the construction of inheriting kinematics which currently can only be rigid body kinematics. The kinematic is concerned with the mechanics and motion of the heliostats and their actuators. The abstract base class defines two methods to determine orientation matrices, which all kinematics need to overwrite. .. py:method:: incident_ray_directions_to_orientations(incident_ray_directions: torch.Tensor, aim_points: torch.Tensor, device: Optional[torch.device] = None) -> torch.Tensor :abstractmethod: Compute orientation matrices given incident ray directions. Parameters ---------- incident_ray_directions : torch.Tensor The directions of the incident rays as seen from the heliostats. Tensor of shape [number_of_active_heliostats, 4]. aim_points : torch.Tensor The aim points for the active heliostats. Tensor of shape [number_of_active_heliostats, 4]. device : Optional[torch.device] 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 ------ NotImplementedError Whenever called (abstract base class method). .. py:method:: motor_positions_to_orientations(motor_positions: torch.Tensor, device: Optional[torch.device] = None) -> torch.Tensor :abstractmethod: Compute orientation matrices given the motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. device : Optional[torch.device] 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 ------ NotImplementedError Whenever called (abstract base class method). .. py:method:: forward(incident_ray_directions: torch.Tensor, aim_points: torch.Tensor, device: Optional[torch.device] = None) -> torch.Tensor Specify the forward operation of the kinematic, i.e., calculate orientation matrices given the incident ray directions. Parameters ---------- incident_ray_directions : torch.Tensor The directions of the incident rays as seen from the heliostats. Tensor of shape [number_of_active_heliostats, 4]. aim_points : torch.Tensor The aim points for the active heliostats. Tensor of shape [number_of_active_heliostats, 4]. device : Optional[torch.device] 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 orientation matrices. Tensor of shape [number_of_active_heliostats, 4, 4]. .. py:class:: RigidBody(number_of_heliostats: int, heliostat_positions: torch.Tensor, initial_orientations: torch.Tensor, translation_deviation_parameters: torch.Tensor, rotation_deviation_parameters: torch.Tensor, actuator_parameters_non_optimizable: torch.Tensor, actuator_parameters_optimizable: torch.Tensor = torch.tensor([]), device: torch.device | None = None) Bases: :py:obj:`artist.field.kinematic.Kinematic` Initialize a rigid body kinematic. The rigid body kinematic determines transformation matrices that are applied to the heliostat surfaces in order to align them. The heliostats then reflect the incoming light according to the provided aim points. The rigid body kinematic works for heliostats equipped with two actuators that turn the heliostat surfaces. Furthermore, initial orientation offsets and deviation parameters determine the specific behavior of the kinematic. The kinematic deviations are split into translation and rotation parameters. There are three translation parameters for each joint and for the concentrator. One translation deviation in the east, north and up direction respectively. For joint one and two there are also rotation deviations. For joint one in the north and up direction and for joint two in the east and north direction. Parameters ---------- number_of_heliostats : int The number of heliostats using this rigid body kinematic. heliostat_positions : torch.Tensor The positions of all heliostats. Tensor of shape [number_of_heliostats, 4]. initial_orientations : torch.Tensor The initial orientation offsets of all heliostats. Tensor of shape [number_of_heliostats, 4]. translation_deviation_parameters : torch.Tensor Kinematic translation deviation parameter. Tensor of shape [number_of_heliostats, 9]. rotation_deviation_parameters : torch.Tensor Kinematic rotation deviation parameter. Tensor of shape [number_of_heliostats, 4]. actuator_parameters_non_optimizable : torch.Tensor The non-optimizable actuator parameters. Tensor of shape [number_of_heliostats, 7, 2] for linear actuators or [number_of_heliostats, 4, 2] for ideal actuators. actuator_parameters_optimizable : torch.Tensor The optimizable actuator parameters. Tensor of shape [number_of_heliostats, 2, 2] for linear actuators or [] for ideal actuators (default is torch.tensor([])). 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. .. py:attribute:: number_of_heliostats .. py:attribute:: heliostat_positions .. py:attribute:: initial_orientations .. py:attribute:: motor_positions .. py:attribute:: translation_deviation_parameters .. py:attribute:: rotation_deviation_parameters .. py:attribute:: number_of_active_heliostats :value: 0 .. py:attribute:: active_heliostat_positions .. py:attribute:: active_initial_orientations .. py:attribute:: active_translation_deviation_parameters .. py:attribute:: active_rotation_deviation_parameters .. py:attribute:: active_motor_positions .. py:attribute:: artist_standard_orientation .. py:attribute:: actuators .. py:method:: _compute_orientations_from_motor_positions(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Compute orientation matrices from given motor positions without initial orientation offsets. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 orientation matrices. Tensor of shape [number_of_active_heliostats, 4, 4]. .. py:method:: _apply_initial_orientation_offsets(orientations: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Apply the initial orientation offsets to the given orientation matrices. Parameters ---------- orientations : torch.Tensor The orientation matrices. Tensor of shape [number_of_active_heliostats, 4, 4]. 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 orientation matrices with the initial orientation offset. Tensor of shape [number_of_active_heliostats, 4, 4]. .. py:method:: incident_ray_directions_to_orientations(incident_ray_directions: torch.Tensor, aim_points: torch.Tensor, device: torch.device | None = None, max_num_iterations: int = 2, min_eps: float = 0.0001) -> torch.Tensor Compute orientation matrices given incident ray directions. Parameters ---------- incident_ray_directions : torch.Tensor The directions of the incident rays as seen from the heliostats. Tensor of shape [number_of_active_heliostats, 4]. aim_points : torch.Tensor The aim points for the active heliostats. Tensor of shape [number_of_active_heliostats, 4]. max_num_iterations : int Maximum number of iterations (default is 2). min_eps : float Convergence criterion (default is 0.0001). 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 orientation matrices. Tensor of shape [number_of_active_heliostats, 4, 4]. .. py:method:: motor_positions_to_orientations(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Compute orientation matrices given the motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. 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 orientation matrices. Tensor of shape [number_of_active_heliostats, 4, 4]. .. py:class:: Surface(surface_config: artist.scenario.configuration_classes.SurfaceConfig, device: torch.device | None = None) Initialize the surface of one heliostat. The heliostat surface consists of one or more facets. The surface only describes the mirrors on the heliostat, not the whole heliostat. The surface can be aligned through the kinematic and its actuators. Each surface and thus each facet is defined through NURBS, the discrete surface points and surface normals can be retrieved. Parameters ---------- surface_config : SurfaceConfig The surface configuration parameters used to construct the surface. 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. .. py:attribute:: nurbs_facets :value: [] .. py:method:: get_surface_points_and_normals(number_of_points_per_facet: torch.Tensor, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Calculate all surface points and normals from all facets. Parameters ---------- number_of_points_per_facet : torch.Tensor The number of sampling points along each direction of each 2D facet. Tensor of shape [2]. 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 surface points for one heliostat, tensor of shape [number_of_facets, number_of_surface_points_per_facet, 4]. torch.Tensor The surface normals for one heliostat, tensor of shape [number_of_facets, number_of_surface_normals_per_facet, 4]. .. py:class:: TowerTargetAreas(names: list[str], geometries: list[str], centers: torch.Tensor, normal_vectors: torch.Tensor, dimensions: torch.Tensor, curvatures: torch.Tensor) Initialize the target area array. A target area array consists of one or more target areas that are positioned on the solar tower, in front of the heliostats. The target area array is provided with a list of target areas to initialize the target areas. Parameters ---------- names : list[str] The names of each target area. geometries : list[str] The type of geometry of each target area. centers : torch.Tensor The center point coordinate of each target area. Tensor of shape [number_of_target_areas, 4]. normal_vectors : torch.Tensor The normal vector of each target area. Tensor of shape [number_of_target_areas, 4]. dimensions : torch.Tensor The dimensions of each target area (width, then height). Tensor of shape [number_of_target_areas, 2]. curvatures : torch.Tensor The curvature of the target area in 2 dimensions (0.0 if not applicable). Tensor of shape [number_of_target_areas, 2]. .. py:attribute:: names .. py:attribute:: geometries .. py:attribute:: centers .. py:attribute:: normal_vectors .. py:attribute:: dimensions .. py:attribute:: curvatures .. py:attribute:: number_of_target_areas .. py:method:: from_hdf5(config_file: h5py.File, device: torch.device | None = None) -> typing_extensions.Self :classmethod: Load all target areas from an HDF5 file. Parameters ---------- config_file : h5py.File The HDF5 file containing the configuration to be loaded. 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 ------- TowerTargetAreas The target areas loaded from the HDF5 file.