improver.wxcode.wxcode_utilities module¶
This module defines the utilities required for wxcode plugin
-
improver.wxcode.wxcode_utilities.add_wxcode_metadata(cube)[source]¶ Add weather code metadata to a cube :param cube: Cube which needs weather code metadata added. :type cube: Iris.cube.Cube
Returns: Cube with weather code metadata added. Return type: cube (Iris.cube.Cube)
-
improver.wxcode.wxcode_utilities.expand_nested_lists(query, key)[source]¶ Produce flat lists from list and nested lists.
Parameters: - query (dict) – A single query from the decision tree.
- key (string) – A string denoting the field to be taken from the dict.
Returns: A 1D list containing all the values for a given key.
Return type: items (list)
-
improver.wxcode.wxcode_utilities.update_daynight(cubewx)[source]¶ Update weather cube depending on whether it is day or night
Parameters: cubewx (Iris.cube.Cube) – Cube containing only daytime weather symbols. Returns: Cube containing day and night weather symbols Return type: cubewx_daynight(Iris.cube.Cube) Raises: CoordinateNotFoundError– cube must have time coordinate.