artist.field ============ .. py:module:: artist.field 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/kinematics/index /autoapi/artist/field/kinematics_rigid_body/index /autoapi/artist/field/solar_tower/index /autoapi/artist/field/surface/index /autoapi/artist/field/tower_target_areas/index /autoapi/artist/field/tower_target_areas_cylindrical/index /autoapi/artist/field/tower_target_areas_planar/index Classes ------- .. autoapisummary:: artist.field.Actuators artist.field.IdealActuators artist.field.LinearActuators artist.field.HeliostatField artist.field.HeliostatGroup artist.field.HeliostatGroupRigidBody artist.field.Kinematics artist.field.RigidBody artist.field.SolarTower artist.field.Surface artist.field.TowerTargetAreas artist.field.TowerTargetAreasCylindrical artist.field.TowerTargetAreasPlanar 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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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([])``). Shape is ``[]``. 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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[number_of_heliostats, 7, 2]``. optimizable_parameters : torch.Tensor The two optimizable actuator parameters, describing the initial actuator configuration. Shape is ``[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. Shape is ``[number_of_active_heliostats, 7, 2]``. torch.Tensor The physics-informed non-optimizable parameters. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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 : 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.util.config.SurfaceConfig, prototype_kinematics: 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) -> 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_kinematics : dict[str, str | torch.Tensor] The prototype for the kinematics, 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. Shape is ``[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. Shape is ``[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 ------ ValueError If neither prototypes nor individual heliostat parameters are provided. Returns ------- HeliostatField The heliostat field loaded from the HDF5 file. .. py:method:: update_surfaces(device: torch.device | None = None) -> None Update surface points and normals using new NURBS control points. Parameter --------- 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:: HeliostatGroup(names: list[str], positions: torch.Tensor, surface_points: torch.Tensor, surface_normals: torch.Tensor, canting: torch.Tensor, facet_translations: 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. Shape is ``[number_of_heliostats, 4]``. surface_points : torch.Tensor The surface points of all heliostats in the group. Shape is ``[number_of_heliostats, number_of_combined_surface_points_all_facets, 4]``. surface_normals : torch.Tensor The surface normals of all heliostats in the group. Shape is ``[number_of_heliostats, number_of_combined_surface_normals_all_facets, 4]``. initial_orientations : torch.Tensor The initial orientations of all heliostats in the group. Shape is ``[number_of_heliostats, 4]``. nurbs_control_points : torch.Tensor The control points for NURBS surfaces for all heliostats in the group. Shape is ``[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. Shape is ``[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:: canting .. py:attribute:: facet_translations .. py:attribute:: initial_orientations .. py:attribute:: nurbs_control_points .. py:attribute:: nurbs_degrees .. py:attribute:: kinematics .. 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_canting .. py:attribute:: active_facet_translations .. 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. Shape is ``[number_of_active_heliostats, 4]``. incident_ray_directions : torch.Tensor The incident ray directions. Shape is ``[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. 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 ------ 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. Shape is ``[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. 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 ------ 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 kinematics 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. 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. .. py:class:: HeliostatGroupRigidBody(names: list[str], positions: torch.Tensor, surface_points: torch.Tensor, surface_normals: torch.Tensor, canting: torch.Tensor, facet_translations: torch.Tensor, initial_orientations: torch.Tensor, nurbs_control_points: torch.Tensor, nurbs_degrees: torch.Tensor, kinematics_translation_deviation_parameters: torch.Tensor, kinematics_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 kinematics 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. Shape is ``[number_of_heliostats, 4]``. surface_points : torch.Tensor The surface points of all heliostats in the group. Shape is ``[number_of_heliostats, number_of_combined_surface_points_all_facets, 4]``. surface_normals : torch.Tensor The surface normals of all heliostats in the group. Shape is ``[number_of_heliostats, number_of_combined_surface_normals_all_facets, 4]``. initial_orientations : torch.Tensor The initial orientations of all heliostats in the group. Shape is ``[number_of_heliostats, 4]``. nurbs_control_points : torch.Tensor The control points for NURBS surfaces for all heliostats in the group. Shape is ``[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. Shape is ``[2]``. kinematics_translation_deviation_parameters : torch.Tensor The kinematics translation deviation parameters of all heliostats in the group. Shape is ``[number_of_heliostats, 9]``. kinematics_rotation_deviation_parameters : torch.Tensor The kinematics rotation deviation parameters of all heliostats in the group. Shape is ``[number_of_heliostats, 4]``. actuator_parameters_non_optimizable : torch.Tensor The non-optimizable actuator parameters. Shape is ``[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. Shape is ``[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:: kinematics .. 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. Shape is ``[number_of_active_heliostats, 4]``. incident_ray_directions : torch.Tensor The incident ray directions. Shape is ``[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. 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 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. Shape is ``[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. 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 not all heliostats trying to be aligned have been activated. .. py:class:: Kinematics Bases: :py:obj:`torch.nn.Module` Initialize the kinematics. The abstract kinematics implements a template for the construction of inheriting kinematics which currently can only be rigid body kinematics. The kinematics 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: torch.device | None = 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. Shape is ``[number_of_active_heliostats, 4]``. aim_points : torch.Tensor The aim points for the active heliostats. Shape is ``[number_of_active_heliostats, 4]``. device : 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: torch.device | None = None) -> torch.Tensor :abstractmethod: Compute orientation matrices given the motor positions. Parameters ---------- motor_positions : torch.Tensor The motor positions. Shape is ``[number_of_active_heliostats, 2]``. device : 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: torch.device | None = None) -> torch.Tensor Specify the forward operation of the kinematics, 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. Shape is ``[number_of_active_heliostats, 4]``. aim_points : torch.Tensor The aim points for the active heliostats. Shape is ``[number_of_active_heliostats, 4]``. device : 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. Shape is ``[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.kinematics.Kinematics` Initialize a rigid body kinematics. The rigid body kinematics 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 kinematics 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 kinematics. The kinematics 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 kinematics. heliostat_positions : torch.Tensor The positions of all heliostats. Shape is ``[number_of_heliostats, 4]``. initial_orientations : torch.Tensor The initial orientation offsets of all heliostats. Shape is ``[number_of_heliostats, 4]``. translation_deviation_parameters : torch.Tensor Kinematics translation deviation parameter. Shape is ``[number_of_heliostats, 9]``. rotation_deviation_parameters : torch.Tensor Kinematics rotation deviation parameter. Shape is ``[number_of_heliostats, 4]``. actuator_parameters_non_optimizable : torch.Tensor The non-optimizable actuator parameters. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[number_of_active_heliostats, 4]``. aim_points : torch.Tensor The aim points for the active heliostats. Shape is ``[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. Shape is ``[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. Shape is ``[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. Shape is ``[number_of_active_heliostats, 4, 4]``. .. py:class:: SolarTower(target_areas: collections.abc.Sequence[artist.field.tower_target_areas.TowerTargetAreas], device: torch.device | None = None) Initialize the solar tower with its target areas. Parameters ---------- target_areas : Sequence[TowerTargetAreas] A list containing all target area groups. The expected order is planar target areas first, followed by cylindrical target areas. 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:: target_areas .. py:attribute:: number_of_target_area_types .. py:attribute:: number_of_target_areas_per_type .. py:attribute:: target_name_to_index .. py:attribute:: index_to_target_area :value: [] .. py:method:: from_hdf5(config_file: h5py.File, device: torch.device | None = None) -> Self :classmethod: Load a solar tower 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 ------- Self A ``SolarTower`` instance loaded from the HDF5 file. .. py:method:: get_centers_of_target_areas(target_area_indices: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Get the center coordinates of the specified target areas. For planar target areas, the center is returned directly. For cylindrical target areas, the center is offset outward along the surface normal by the cylinder radius, giving the point on the curved surface facing the heliostats. Parameters ---------- target_area_indices : torch.Tensor Global target area indices (planar first, cylindrical second) for which to retrieve the center coordinates. Shape is ``[number_of_active_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 Center coordinates of the requested target areas in homogeneous coordinates. Shape is ``[number_of_active_heliostats, 4]``. .. py:class:: Surface(surface_config: artist.util.config.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 kinematics 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_surface .. py:method:: get_surface_points_and_normals(number_of_points_per_facet: torch.Tensor, canting: torch.Tensor, facet_translations: 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], centers: torch.Tensor, normals: torch.Tensor) Initialize the target areas. Parameters ---------- names : list[str] The name of each target area. centers : torch.Tensor Center point coordinate of each target area. Shape is ``[number_of_target_areas, 4]``. normals : torch.Tensor Normal vector of each target area. Shape is ``[number_of_target_areas, 4]``. .. py:attribute:: names .. py:attribute:: centers .. py:attribute:: normals .. py:attribute:: number_of_target_areas .. py:method:: from_hdf5(config_file: h5py.File, device: torch.device | None = None) -> Self :classmethod: :abstractmethod: 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. Raises ------ NotImplementedError This abstract method must be overridden. .. py:class:: TowerTargetAreasCylindrical(names: list[str], centers: torch.Tensor, normals: torch.Tensor, axes: torch.Tensor, radii: torch.Tensor, heights: torch.Tensor, opening_angles: torch.Tensor) Bases: :py:obj:`artist.field.tower_target_areas.TowerTargetAreas` Initialize the cylindrical target areas. Parameters ---------- names : list[str] Name of each cylindrical target area. centers : torch.Tensor Center coordinate of each cylindrical target area. The center is defined at the halfway point between top and bottom of the cylinder on the cylinder axis. Shape is ``[number_of_target_areas, 4]``. normals : torch.Tensor Normal vector of each cylindrical target area. Shape is ``[number_of_target_areas, 4]``. axes : torch.Tensor Cylinder axes of all cylinder target areas. Shape is ``[number_of_target_areas, 4]``. radii : torch.Tensor Radius of each cylindrical target area. Shape is ``[number_of_target_areas]``. heights : torch.Tensor Height of each cylindrical target area. Shape is ``[number_of_target_areas]``. opening_angles : torch.Tensor Opening angle of each cylindrical target area in radians. For full cylinders, this is 2*pi or 360°. Shape is ``[number_of_target_areas]``. .. py:attribute:: radii .. py:attribute:: heights .. py:attribute:: axes .. py:attribute:: opening_angles .. py:method:: from_hdf5(config_file: h5py.File, device: torch.device | None = None) -> Self :classmethod: Load all cylindrical target areas from an HDF5 file. Parameters ---------- config_file : h5py.File 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 ------- TowerTargetAreasCylindrical Target areas loaded from the HDF5 file. .. py:class:: TowerTargetAreasPlanar(names: list[str], centers: torch.Tensor, normals: torch.Tensor, dimensions: torch.Tensor) Bases: :py:obj:`artist.field.tower_target_areas.TowerTargetAreas` Initialize the planar target areas. Parameters ---------- names : list[str] Name of each planar target area. centers : torch.Tensor Center point coordinate of each planar target area. Shape is ``[number_of_target_areas, 4]``. normals : torch.Tensor Normal vector of each planar target area. Shape is ``[number_of_target_areas, 4]``. dimensions : torch.Tensor Dimensions of each planar target area (width, then height). Shape is ``[number_of_target_areas, 2]``. .. py:attribute:: dimensions .. py:method:: from_hdf5(config_file: h5py.File, device: torch.device | None = None) -> Self :classmethod: Load all planar target areas from an HDF5 file. Parameters ---------- config_file : h5py.File 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 ------- TowerTargetAreasPlanar Target areas loaded from the HDF5 file.