improver.utilities.cube_constraints module

Module for helping to create Iris constraints.

improver.utilities.cube_constraints.create_sorted_lambda_constraint(coord_name, values)[source]

Create a lambda constraint for a range. This formulation of specifying a lambda constraint has the benefit of not needing to hardcode the name for the coordinate, so that this can be determined at runtime.

Parameters:
  • coord_name (str) – Name of the coordinate.
  • values (list) – A list of two values that represent the inclusive end points of a range.
Returns:

Constraint representative of a range of values.

Return type:

constr (iris.Constraint)