artist.io
Submodules
Classes
Initialize the the base data parser. |
|
Initialize the PAINT calibration data parser. |
Functions
|
Convert a scenario file with heliostats in the legacy layout to the columnar layout. |
Package Contents
- class artist.io.CalibrationDataParser(sample_limit: int | None = None)
Initialize the the base data parser.
Parameters
- sample_limitint | None
The number specifying the maximum number of samples to be loaded (default is None).
- sample_limit = None
- abstractmethod parse_data_for_reconstruction(heliostat_data_mapping: list[tuple[str, list[pathlib.Path], list[pathlib.Path]]], heliostat_group: artist.field.heliostat_group.HeliostatGroup, scenario: artist.scenario.scenario.Scenario, bitmap_resolution: torch.Tensor = torch.tensor([indices.bitmap_resolution, indices.bitmap_resolution]), device: torch.device | None = None) tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
Extract measured fluxes and their respective calibration properties data.
Parameters
- heliostat_data_mappinglist[tuple[str, list[pathlib.Path], list[pathlib.Path]]]
The mapping from heliostat to calibration data files.
- heliostat_groupHeliostatGroup
The heliostat group.
- scenarioScenario
The scenario.
- bitmap_resolutiontorch.Tensor
The resolution of all bitmaps during reconstruction (default is torch.tensor([256,256])). Shape is
[2].- 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
- The measured flux density distributions.
Shape is
[number_of_active_heliostats, bitmap_resolution_e, bitmap_resolution_u].- torch.Tensor
The calibration focal spots. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The incident ray directions. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The motor positions. Shape is
[number_of_calibration_data_points, 2].- torch.Tensor
A mask with active heliostats and their replications. Shape is
[number_of_heliostats].- torch.Tensor
The target area mapping for the heliostats. Shape is
[number_of_active_heliostats].
- load_flux_from_png(heliostat_flux_path_mapping: list[tuple[str, list[pathlib.Path]]], heliostat_names: list[str], resolution: torch.Tensor = torch.tensor([indices.bitmap_resolution, indices.bitmap_resolution]), device: torch.device | None = None) torch.Tensor
Load flux density distributions as tensors from png images.
Note that the order of width and height are reversed in
PILandtorch.PILtakes (width, height), whiletorchtensors are [height, width].Parameters
- heliostat_flux_path_mappinglist[tuple[str, list[pathlib.Path]]]
The mapping of heliostats and their measured flux density distributions.
- heliostat_nameslist[str]
All possible heliostat names.
- resolutiontorch.Tensor
The resolution of the loaded png files (default is torch.tensor([256,256])). Shape is
[2].- 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
- torch.Tensor
The measured flux density distributions. Shape is
[number_of_active_heliostats, bitmap_resolution_e, bitmap_resolution_u].
- artist.io.convert_scenario_to_columnar(input_path: pathlib.Path | str, output_path: pathlib.Path | str) None
Convert a scenario file with heliostats in the legacy layout to the columnar layout.
Everything apart from the heliostats is copied unchanged. Scenarios in the columnar layout load faster, especially for large heliostat fields, and yield exactly the same scenario.
Parameters
- input_pathpathlib.Path | str
The scenario file with heliostats in the legacy layout.
- output_pathpathlib.Path | str
The file to write the converted scenario to. It must differ from the input file.
Raises
- ValueError
If the heliostats of the input file are already stored in the columnar layout, or input and output are the same file.
- ColumnarLayoutError
If the heliostats cannot be stored in the columnar layout.
- class artist.io.PaintCalibrationDataParser(sample_limit: int | None = None, centroid_extraction_method: str = paint_mappings.UTIS_KEY)
Bases:
artist.io.calibration_parser.CalibrationDataParserInitialize the PAINT calibration data parser.
Parameters
- sample_limitint | None
The number specifying the maximum number of samples to be loaded (default is None).
- centroid_extraction_methodstr
The method by which the focal spot centroid was extracted (default is the centroid extracted by
UTIS).
- centroid_extraction_method
- parse_data_for_reconstruction(heliostat_data_mapping: list[tuple[str, list[pathlib.Path], list[pathlib.Path]]], heliostat_group: artist.field.heliostat_group.HeliostatGroup, scenario: artist.scenario.scenario.Scenario, bitmap_resolution: torch.Tensor = torch.tensor([indices.bitmap_resolution, indices.bitmap_resolution]), device: torch.device | None = None) tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
Extract measured fluxes and their respective calibration properties data.
Parameters
- heliostat_data_mappinglist[tuple[str, list[pathlib.Path], list[pathlib.Path]]]
The mapping from heliostat to calibration data files.
- heliostat_groupHeliostatGroup
The heliostat group.
- scenarioScenario
The scenario.
- bitmap_resolutiontorch.Tensor
The resolution of all bitmaps during reconstruction (default is
torch.tensor([256,256])). Shape is[2].- 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
- torch.Tensor
The measured flux density distributions. Shape is
[number_of_active_heliostats, bitmap_resolution_e, bitmap_resolution_u].- torch.Tensor
The calibration focal spots. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The incident ray directions. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The motor positions. Shape is
[number_of_calibration_data_points, 2].- torch.Tensor
A mask with active heliostats and their replications. Shape is
[number_of_heliostats].- torch.Tensor
The target area mapping for the heliostats. Shape is
[number_of_active_heliostats].
- _parse_calibration_data(heliostat_calibration_mapping: list[tuple[str, list[pathlib.Path]]], heliostat_names: list[str], target_name_to_index: dict[str, int], power_plant_position: torch.Tensor, device: torch.device | None = None) tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
Extract calibration data from PAINT calibration files.
Parameters
- heliostat_calibration_mappinglist[tuple[str, list[pathlib.Path]]]
The mapping of heliostats and their calibration data files.
- power_plant_positiontorch.Tensor
The power plant position. Shape is
[3].- heliostat_nameslist[str]
All possible heliostat names.
- target_name_to_indexdict[str, int]
A mapping from target name to its index.
- 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
- torch.Tensor
The calibration focal spots. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The incident ray directions. Shape is
[number_of_calibration_data_points, 4].- torch.Tensor
The motor positions. Shape is
[number_of_calibration_data_points, 2].- torch.Tensor
A mask with active heliostats and their replications. Shape is
[number_of_heliostats].- torch.Tensor
The target area mapping for the heliostats. Shape is
[number_of_active_heliostats].