artist.optim.kinematics_reconstructor

Attributes

log

A logger for the kinematic reconstructor.

Classes

KinematicsReconstructor

Initialize the kinematics optimizer.

Module Contents

artist.optim.kinematics_reconstructor.log

A logger for the kinematic reconstructor.

class artist.optim.kinematics_reconstructor.KinematicsReconstructor(ddp_setup: artist.util.env.DdpSetup, scenario: artist.scenario.scenario.Scenario, data: dict[str, artist.io.calibration_parser.CalibrationDataParser | list[tuple[str, list[pathlib.Path], list[pathlib.Path]]]], optimization_configuration: dict[str, Any], dni: float | None = None, reconstruction_method: str = constants.kinematics_reconstruction_raytracing, bitmap_resolution: torch.Tensor = torch.tensor([256, 256]))

Initialize the kinematics optimizer.

Parameters

ddp_setupDdpSetup

Information about the distributed environment, process groups, devices, ranks, world size, and heliostat-group-to-ranks mapping.

scenarioScenario

The scenario.

datadict[str, CalibrationDataParser | list[tuple[str, list[pathlib.Path], list[pathlib.Path]]]]

The data parser and the mapping of heliostat name and calibration data.

optimization_configurationdict[str, Any]

Parameters for the optimizer, learning rate scheduler, regularizers, and early stopping.

dnifloat | None

Direct normal irradiance in W/m^2 (default is None which leads to a ray magnitude of 1.0).

reconstruction_methodstr

The reconstruction method. Currently, only reconstruction via ray tracing is implemented.

bitmap_resolutiontorch.Tensor

The resolution of all bitmaps during reconstruction (default is torch.tensor([256, 256])). Shape is [2].

ddp_setup
scenario
data
optimizer_dict
scheduler_dict
dni = None
bitmap_resolution
reconstruct_kinematics(loss_definition: artist.optim.loss.Loss, device: torch.device | None = None) tuple[torch.Tensor, list[Any]]

Reconstruct the kinematic parameters.

Parameters

loss_definitionLoss

The definition of the loss function and pre-processing of the prediction.

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.

Returns

torch.Tensor

The final loss of the kinematics reconstruction for each heliostat in each group. Shape is [total_number_of_heliostats_in_scenario].

list[list[dict[str, list[float]]]]

Loss histories over epochs grouped by rank. Outer list: one entry per rank. Inner list: one entry per heliostat group processed on that rank. Each group entry is a dict with key "total_loss" mapping to a list of per-epoch scalar loss values. In non-distributed mode, this is a single-rank container: [local_group_histories].

_reconstruct_kinematics_parameters_with_raytracing(loss_definition: artist.optim.loss.Loss, device: torch.device | None = None) tuple[torch.Tensor, list[list[dict[str, list[float]]]]]

Reconstruct the kinematics parameters using ray tracing.

This reconstruction method optimizes the kinematics parameters by extracting the focal points of calibration images and using heliostat-tracing.

Parameters

loss_definitionLoss

Definition of the loss function and pre-processing of the prediction.

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.

Returns

torch.Tensor

The final loss of the kinematics reconstruction for each heliostat in each group. Shape is [total_number_of_heliostats_in_scenario].

list[list[dict[str, list[float]]]]

Loss histories over epochs grouped by rank. Outer list: one entry per rank. Inner list: one entry per heliostat group processed on that rank. Each group entry is a dict with key "total_loss" mapping to a list of per-epoch scalar loss values. In non-distributed mode, this is a single-rank container: [local_group_histories].