artist.io.h5_scenario_parser ============================ .. py:module:: artist.io.h5_scenario_parser Functions --------- .. autoapisummary:: artist.io.h5_scenario_parser.surface_config artist.io.h5_scenario_parser.kinematics_deviations artist.io.h5_scenario_parser.rigid_body_deviations artist.io.h5_scenario_parser.actuator_parameters artist.io.h5_scenario_parser.linear_actuators artist.io.h5_scenario_parser.ideal_actuators Module Contents --------------- .. py:function:: surface_config(prototype: bool, scenario_file: h5py.File, device: torch.device | None = None) -> artist.util.config.SurfaceConfig Load a surface configuration from an HDF5 scenario file. Parameters ---------- prototype : bool Whether a prototype or an individual surface configuration should be loaded. scenario_file : h5py.File The opened scenario HDF5 file containing the information. 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 ------- SurfaceConfig The surface configuration. .. py:function:: kinematics_deviations(prototype: bool, kinematics_type: str, scenario_file: h5py.File, log: logging.Logger, heliostat_name: str | None = None, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor, int] Load kinematics deviations from an HDF5 scenario file. Parameters ---------- prototype : bool Whether a prototype or individual kinematics deviations should be loaded. kinematics_type : str The kinematics type. scenario_file : h5py.File The opened scenario HDF5 file containing the information. log : logging.Logger The logger for the scenario loader. heliostat_name : str | None The heliostat name, only needed for individual heliostats, not prototypes (default is None). 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 kinematics type in the scenario file is unknown. Returns ------- torch.Tensor Translation deviation parameters for the kinematics. torch.Tensor Rotation deviation parameters for the kinematics. int The number of actuators needed for this kinematics type. .. py:function:: rigid_body_deviations(kinematics_config: h5py.File, log: logging.Logger, heliostat_name: str | None = None, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Load kinematics deviations for a rigid body kinematics from an HDF5 scenario file. Parameters ---------- kinematics_config : h5py.File The opened scenario HDF5 file containing the information. log : logging.Logger The logger for the scenario loader. heliostat_name : str | None The heliostat name, only needed for individual heliostats, not prototypes (default is None). 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 Translation deviation parameters for the kinematics. Shape is ``[9]``. torch.Tensor Rotation deviation parameters for the kinematics. Shape is ``[4]``. .. py:function:: actuator_parameters(prototype: bool, scenario_file: h5py.File, actuator_type: str, number_of_actuators: int, log: logging.Logger, heliostat_name: str | None = None, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Load actuator parameters from an HDF5 scenario file. Parameters ---------- prototype : bool Whether prototype or individual actuator parameters should be loaded. scenario_file : h5py.File The opened scenario HDF5 file containing the information. actuator_type : str The actuator type. number_of_actuators : int The number of actuators. log : logging.Logger The logger for the scenario loader. heliostat_name : str | None The heliostat name, only needed for individual heliostats, not prototypes (default is None). 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 actuator type in the scenario file is unknown. Returns ------- torch.Tensor Non-optimizable actuator parameters for each actuator in the file. torch.Tensor Optimizable actuator parameters for each actuator in the file. .. py:function:: linear_actuators(actuator_config: h5py.File, number_of_actuators: int, log: logging.Logger, heliostat_name: str | None = None, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Load actuator parameters for linear actuators from an HDF5 scenario file. Parameters ---------- actuator_config : h5py.File The opened scenario HDF5 file containing the information. number_of_actuators : int The number of actuators used for a specific kinematics. log : logging.Logger The logger for the scenario loader. heliostat_name : str | None The heliostat name, only needed for individual heliostats, not prototypes (default is None). 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 file contains the wrong number of actuators for a heliostat with a specific kinematics type. Returns ------- torch.Tensor Non-optimizable actuator parameters for each actuator in the file. torch.Tensor Optimizable actuator parameters for each actuator in the file. .. py:function:: ideal_actuators(actuator_config: h5py.File, number_of_actuators: int, device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Load actuator parameters for ideal actuators from an HDF5 scenario file. Parameters ---------- actuator_config : h5py.File The opened scenario HDF5 file containing the information. number_of_actuators : int The number of actuators used for a specific kinematics. 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 file contains the wrong number of actuators for a heliostat with a specific kinematics type. Returns ------- torch.Tensor Non-optimizable actuator parameters for each actuator in the file. torch.Tensor Optimizable actuator parameters for each actuator in the file.