artist.scenario.h5_scenario_generator
Attributes
A logger for the scenario generator. |
Classes
Initialize the scenario generator. |
Module Contents
- artist.scenario.h5_scenario_generator.log
A logger for the scenario generator.
- class artist.scenario.h5_scenario_generator.H5ScenarioGenerator(file_path: pathlib.Path, power_plant_config: artist.util.config.PowerPlantConfig, target_area_list_planar_config: artist.util.config.TargetAreaPlanarListConfig, target_area_list_cylindrical_config: artist.util.config.TargetAreaCylindricalListConfig, light_source_list_config: artist.util.config.LightSourceListConfig, heliostat_list_config: artist.util.config.HeliostatListConfig, prototype_config: artist.util.config.PrototypeConfig, version: float = 1.0)
Initialize the scenario generator.
Scenarios in
ARTISTdescribe the whole environment and all the components of a solar tower power plant. The scenario generator creates the scenarios. A scenario encompasses the tower target area(s), the light source(s), prototypes, and the heliostat(s). The generated scenarios are then saved in HDF5 files.Parameters
- file_pathpathlib.Path
File path to the HDF5 to be saved.
- power_plant_configPowerPlantConfig
Power plant configuration object.
- target_area_list_planar_configTargetAreaPlanarListConfig
Planar target area list configuration object.
- target_area_list_cylindrical_configTargetAreaCylindricalListConfig
Cylindrical target area list configuration object.
- light_source_list_configLightSourceListConfig
Light source list configuration object.
- heliostat_list_configHeliostatListConfig
Heliostat_list configuration object.
- prototype_configPrototypeConfig
Prototype configuration object.
- versionfloat
Version of the scenario generator being used (default is 1.0).
- file_path
- power_plant_config
- target_area_list_planar_config
- target_area_list_cylindrical_config
- light_source_list_config
- heliostat_list_config
- prototype_config
- version = 1.0
- _get_number_of_heliostat_groups() int
Get the number of heliostat groups in the scenario.
Returns
- int
Number of heliostat groups in the scenario.
- _check_equal_facet_numbers() None
Check that each heliostat has the same number of facets.
Raises
- ValueError
If at least one heliostat has a different number of facets.
- _flatten_dict(dictionary: collections.abc.MutableMapping[str, Any], parent_key: str = '', sep: str = '/') dict[str, Any]
Flatten nested dictionaries to first-level keys.
Parameters
- dictionaryMutableMapping[str, Any]
Original nested dictionary to flatten.
- parent_keystr
The parent key of nested dictionaries. Should be empty upon initialization.
- sepstr
The separator used to separate keys in nested dictionaries.
Returns
- dict[str, Any]
A flattened version of the original dictionary.
- _flatten_dict_gen(d: collections.abc.MutableMapping[str, Any], parent_key: str, sep: str) collections.abc.Generator[tuple[str, Any], None, None]
- static _include_parameters(file: h5py.File, prefix: str, parameters: dict[str, Any]) None
Include the parameters from a parameter dictionary.
Parameters
- fileh5py.File
The HDF5 file to write to.
- prefixstr
The prefix used for naming the parameters.
- parametersdict[str, Any]
The parameters to be included into the HDF5 file.
- generate_scenario() None
Generate the scenario and save it as an HDF5 file.
The heliostats are stored in the columnar layout, which stores each heliostat parameter of all heliostats in one dataset and loads fast even for large heliostat fields. If the heliostats cannot be stored in this layout, e.g., because their surfaces have different numbers of control points, they are stored in the legacy layout with one HDF5 group per heliostat instead.