artist.scenario.h5_scenario_generator

Attributes

log

A logger for the scenario generator.

Classes

H5ScenarioGenerator

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.scenario.configuration_classes.PowerPlantConfig, target_area_list_config: artist.scenario.configuration_classes.TargetAreaListConfig, light_source_list_config: artist.scenario.configuration_classes.LightSourceListConfig, heliostat_list_config: artist.scenario.configuration_classes.HeliostatListConfig, prototype_config: artist.scenario.configuration_classes.PrototypeConfig, version: float = 1.0)

Initialize the scenario generator.

Scenarios in ARTIST describe 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

The power plant configuration object.

target_area_list_configTargetAreaListConfig

The target area list configuration object.

light_source_list_configLightSourceListConfig

The light source list configuration object.

heliostat_list_configHeliostatListConfig

The heliostat_list configuration object.

prototype_configPrototypeConfig

The prototype configuration object.

versionfloat

The version of the scenario generator being used (default is 1.0).

file_path
power_plant_config
target_area_list_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()

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, parent_key: str = '', sep: str = '/') dict[str, Any]

Flatten nested dictionaries to first-level keys.

Parameters

dictionaryMutableMapping

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, parent_key: str, sep: str) Generator
static _include_parameters(file: h5py.File, prefix: str, parameters: dict) 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

The parameters to be included into the HFD5 file.

generate_scenario() None

Generate the scenario and save it as an HDF5 file.