artist.scene.light_source

Classes

LightSource

Initialize the light source.

Module Contents

class artist.scene.light_source.LightSource(number_of_rays: int)

Initialize the light source.

The abstract light source implements a template for the construction of light sources which can be of various types. The most noticeable light source is the sun, however, drones could carry artificial light sources and distribute this light on specific heliostats for calibration purposes. Currently, only the sun is implemented.

Parameters

number_of_raysint

The number of sent-out rays sampled from the sun distribution.

number_of_rays
classmethod from_hdf5(config_file: h5py.File, light_source_name: str | None = None, device: torch.device | None = None) typing_extensions.Self
Abstractmethod:

Load the light source from an HDF5 file.

Parameters

config_fileh5py.File

The HDF5 file containing the information about the light sources.

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, ARTIST will automatically select the most appropriate device (CUDA or CPU) based on availability and OS.

Raises

NotImplementedError

Whenever called (abstract base class method).

abstractmethod get_distortions(number_of_points: int, number_of_heliostats: int, random_seed: int = 7) tuple[torch.Tensor, torch.Tensor]

Get distortions given the light source model.

This function gets the distortions that are later used to model possible ray directions that are being generated from the light source. Depending on the model of the light source, the distortions are generated differently.

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).

Raises

NotImplementedError

Whenever called (abstract base class method).