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

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 (str) – 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

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

iris.cube.Cube

Raises

CoordinateNotFoundError – cube must have time coordinate.