artist.io ========= .. py:module:: artist.io Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/artist/io/calibration_parser/index /autoapi/artist/io/h5_scenario_parser/index /autoapi/artist/io/paint_calibration_parser/index /autoapi/artist/io/paint_scenario_parser/index /autoapi/artist/io/stral_scenario_parser/index Classes ------- .. autoapisummary:: artist.io.CalibrationDataParser artist.io.PaintCalibrationDataParser Package Contents ---------------- .. py:class:: CalibrationDataParser(sample_limit: int | None = None) Initialize the the base data parser. Parameters ---------- sample_limit : int | None The number specifying the maximum number of samples to be loaded (default is None). .. py:attribute:: sample_limit :value: None .. py: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] :abstractmethod: Extract measured fluxes and their respective calibration properties data. Parameters ---------- heliostat_data_mapping : list[tuple[str, list[pathlib.Path], list[pathlib.Path]]] The mapping from heliostat to calibration data files. heliostat_group : HeliostatGroup The heliostat group. scenario : Scenario The scenario. bitmap_resolution : torch.Tensor The resolution of all bitmaps during reconstruction (default is torch.tensor([256,256])). Shape is ``[2]``. device : torch.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 ------- 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]``. .. py:method:: 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 ``PIL`` and ``torch``. ``PIL`` takes (width, height), while ``torch`` tensors are [height, width]. Parameters ---------- heliostat_flux_path_mapping : list[tuple[str, list[pathlib.Path]]] The mapping of heliostats and their measured flux density distributions. heliostat_names : list[str] All possible heliostat names. resolution : torch.Tensor The resolution of the loaded png files (default is torch.tensor([256,256])). Shape is ``[2]``. device : torch.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 measured flux density distributions. Shape is ``[number_of_active_heliostats, bitmap_resolution_e, bitmap_resolution_u]``. .. py:class:: PaintCalibrationDataParser(sample_limit: int | None = None, centroid_extraction_method: str = paint_mappings.UTIS_KEY) Bases: :py:obj:`artist.io.calibration_parser.CalibrationDataParser` Initialize the PAINT calibration data parser. Parameters ---------- sample_limit : int | None The number specifying the maximum number of samples to be loaded (default is None). centroid_extraction_method : str The method by which the focal spot centroid was extracted (default is the centroid extracted by ``UTIS``). .. py:attribute:: centroid_extraction_method .. py: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_mapping : list[tuple[str, list[pathlib.Path], list[pathlib.Path]]] The mapping from heliostat to calibration data files. heliostat_group : HeliostatGroup The heliostat group. scenario : Scenario The scenario. bitmap_resolution : torch.Tensor The resolution of all bitmaps during reconstruction (default is ``torch.tensor([256,256])``). Shape is ``[2]``. device : torch.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 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]``. .. py:method:: _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_mapping : list[tuple[str, list[pathlib.Path]]] The mapping of heliostats and their calibration data files. power_plant_position : torch.Tensor The power plant position. Shape is ``[3]``. heliostat_names : list[str] All possible heliostat names. target_name_to_index : dict[str, int] A mapping from target name to its index. device : torch.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 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]``.