iris.experimental.stratify¶
Routines for putting data on new strata (aka. isosurfaces), often in the Z direction.
In this module:

iris.experimental.stratify.
relevel
(cube, src_levels, tgt_levels, axis=None, interpolator=None)¶ Interpolate the cube onto the specified target levels, given the source levels of the cube.
For example, suppose we have two datasets P(i,j,k) and H(i,j,k) and we want P(i,j,H). We call
relevel()
with cube=P, src_levels=H and tgt_levels being an array of the values of H we would like.This routine is especially useful for computing isosurfaces of phenomenon that are generally monotonic in the direction of interpolation, such as height/pressure or salinity/depth.
 cube :
 The phenomenon data to be relevelled.
 src_levels :
 Describes the source levels of the cube that will be interpolated over. The src_levels must be in the same system as the tgt_levels. The dimensions of src_levels must be broadcastable to the dimensions of the cube. Note that, the coordinate name containing the source levels in the cube may be provided.
 tgt_levels : arraylike
 Describes the target levels of the cube to be interpolated to. The tgt_levels must be in the same system as the src_levels. The dimensions of the tgt_levels must be broadcastable to the dimensions of the cube, except in the nominated axis of interpolation.
 axis : int,
 The axis of interpolation. Defaults to the first dimension of the cube, which is typically the zdimension. Note that, the coordinate name specifying the zdimension of the cube may be provided.
 interpolator : callable or None
The interpolator to use when computing the interpolation. The function will be passed the following positional arguments:
(tgtdata, srcdata, cubedata, axisofinterpolation)
If the interpolator is None,
stratify.interpolate()
will be used with linear interpolation and NaN extrapolation.An example of constructing an alternative interpolation scheme:
from functools import partial interpolator = partial(stratify.interpolate,
interpolation=stratify.INTERPOLATE_NEAREST, extrapolation=stratify.EXTRAPOLATE_LINEAR)
Cube
Cube
,Coord
or stringCoord
or string