Subset cubes using constraints#

Subset cubes using iris constraints.

class aeolus.subset.DimConstr(model=Model [99 fields])[source]#

Bases: object

Container for strict or relaxed dimensional constraints.

Examples

Extract cubes that have y and x dimensional coordinates (among others):

>>> dc = DimConstr()
>>> cubelist.extract(dc.relax.yx)

Extract cubes that only have model levels, y and x dimensions:

>>> dc = DimConstr()
>>> cubelist.extract(dc.strict.myx)
__init__(model=Model [99 fields])[source]#

Initialise DimConstr.

Parameters:

model (aeolus.model.Model, optional) – Model class with relevant coordinate names.

aeolus.subset.extract_after_n_days(cube, days=365, model=Model [99 fields])[source]#

Extract time slices after the given number of days.

aeolus.subset.extract_between_days(cube, day_start, day_end, model=Model [99 fields])[source]#

Subset between day_start and day_end of its time coordinate.

aeolus.subset.extract_last_month(cube, model=Model [99 fields])[source]#

Extract time slices within the last months of a cube.

aeolus.subset.extract_last_n_days(cube, days=365, model=Model [99 fields])[source]#

Extract time slices within the last n days of its time dimension.

aeolus.subset.l_range_constr(h_min, h_max, units='km', coord='level_height')[source]#

Make a constraint on length range.

aeolus.subset.unique_cubes(cubelist)[source]#

Remove duplicate cubes from iris.cube.CubeList.