improver.synthetic_data.utilities module

Functions required for additional processing in generate_metadata_cube CLI.

_error_more_than_one_leading_dimension()[source]

Raises an error to inform the user that only one leading dimension can be provided in the input data.

get_height_levels(coord_data)[source]

Gets height level values from coords nested dictionary and sets pressure value based on whether heights or pressures key is used.

Parameters:

coord_data (Dict[str, Any]) – Dictionary containing values to use for either height or pressure levels.

Return type:

Tuple[List[float], bool]

Returns:

A tuple containing a list of values to use for the height/pressure dimension and a bool specifying whether the coordinate should be created as height levels or pressure levels.

get_leading_dimension(coord_data)[source]

Gets leading dimension values from coords nested dictionary and sets cube type based on what dimension key is used.

Parameters:

coord_data (Dict[str, Any]) – Dictionary containing values to use for either realizations, percentiles or thresholds.

Return type:

Tuple[List[float], str]

Returns:

A tuple containing the list of values to use for the leading dimension and a string specifying what cube type to create.