artist.scene.sun
Attributes
A logger for the sun. |
Classes
Initialize the sun as a light source. |
Module Contents
- artist.scene.sun.log
A logger for the sun.
- class artist.scene.sun.Sun(number_of_rays: int, distribution_parameters: dict[str, Any] = dict(distribution_type='normal', mean=0.0, covariance=4.3681e-06), device: torch.device | None = None)
Bases:
artist.scene.light_source.LightSourceInitialize the sun as a light source.
The sun is one type of light source that can be implemented in
ARTIST. The number of rays sent out by the light source per heliostat surface point must be specified. If more rays are sent out, the resulting flux density distribution on the receiver is higher. Furthermore, each light source also implements theget_distortionsfunction required to scatter the light.Parameters
- number_of_raysint
The number of sent-out rays sampled from the sun distribution.
- distribution_parameters
Parameters of the distribution used to model the sun.
- devicetorch.device | None
The device on which to perform computations or load tensors and models (default is None). If None,
ARTISTwill automatically select the most appropriate device (CUDA or CPU) based on availability and OS.
Raises
- ValueError
If the specified distribution type is unknown.
- distribution_parameters
- number_of_rays
- classmethod from_hdf5(config_file: h5py.File, light_source_name: str | None = None, device: torch.device | None = None) typing_extensions.Self
Class method that initializes a sun from an HDF5 file.
Parameters
- config_fileh5py.File
The HDF5 file containing the information about the sun.
- light_source_namestr | None
The name of the light source - used for logging.
- devicetorch.device | None
The device on which to perform computations or load tensors and models (default is None). If None,
ARTISTwill automatically select the most appropriate device (CUDA or CPU) based on availability and OS.
Returns
- Sun
A sun initialized from an HDF5 file.
- get_distortions(number_of_points: int, number_of_heliostats: int, random_seed: int = 7) tuple[torch.Tensor, torch.Tensor]
Get distortions given the selected model of the sun.
Parameters
- number_of_pointsint
The number of points on the heliostat from which rays are reflected.
- number_of_facetsint
The number of facets for each heliostat (default: 4).
- number_of_heliostatsint
The number of heliostats in the scenario (default: 1).
- random_seedint
The random seed to enable result replication (default: 7).
Returns
- tuple[torch.Tensor, torch.Tensor]
The distortion in north and up direction.