improver.utilities.cube_constraints module
Module for helping to create Iris constraints.
- create_sorted_lambda_constraint(coord_name, values, tolerance=1e-07)[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.
The created function uses float values. As a result, a small tolerance is used to spread the ends of the ranges to help with float equality matching. Note that the relative tolerance will not affect values of zero. Adding/subtracting an absolute tolerance is not done due to the difficulty of selecting an appropriate value given the very small values of precipitation rates expressed in m s-1.
- Parameters:
- Return type:
- Returns:
Constraint representative of a range of values.