artist.core.surface_reconstructor

Attributes

log

A logger for the surface reconstructor.

Classes

SurfaceReconstructor

Initialize the surface reconstructor.

Module Contents

artist.core.surface_reconstructor.log

A logger for the surface reconstructor.

class artist.core.surface_reconstructor.SurfaceReconstructor(ddp_setup: dict[str, Any], scenario: artist.scenario.scenario.Scenario, data: dict[str, artist.data_parser.calibration_data_parser.CalibrationDataParser | list[tuple[str, list[pathlib.Path], list[pathlib.Path]]]], optimization_configuration: dict[str, Any], number_of_surface_points: torch.Tensor = torch.tensor([50, 50]), bitmap_resolution: torch.Tensor = torch.tensor([256, 256]), device: torch.device | None = None)

Initialize the surface reconstructor.

Parameters

ddp_setupdict[str, Any]

Information about the distributed environment, process_groups, devices, ranks, world_Size, 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]

The parameters for the optimizer, learning rate scheduler and early stopping.

number_of_surface_pointstorch.Tensor

The number of surface points of the reconstructed surfaces (default is torch.tensor([50,50])). Tensor of shape [2].

bitmap_resolutiontorch.Tensor

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

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.

ddp_setup
scenario
data
optimization_configuration
number_of_surface_points
bitmap_resolution
reconstruct_surfaces(loss_definition: artist.core.loss_functions.Loss, device: torch.device | None = None) torch.Tensor

Reconstruct NURBS surfaces from bitmaps.

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 surface reconstruction for each heliostat in each group. Tensor of shape [total_number_of_heliostats_in_scenario].

static lock_control_points_on_outer_edges(gradients: torch.Tensor, device: torch.device | None = None) torch.Tensor

Lock the u and v values of the control points on the outer edges of each facet.

As the knots of the first and last knots on each facet have full multiplicity, the NURBS surfaces all start and end in control points. If the outer control points are not fixed in their u and v values, the reconstructed surfaces may not be rectangular anymore. To keep them rectangular, this function zeros the gradients of the u and v coordinates of all outer control points.

Parameters

gradientstorch.Tensor

The gradients of the outer control points. Tensor of shape [number_of_active_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

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 updated gradients. Tensor of shape [number_of_active_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].