iris.aux_factory#

Definitions of derived coordinates.

class iris.aux_factory.AtmosphereSigmaFactory(pressure_at_top=None, sigma=None, surface_air_pressure=None)[source]#

Bases: AuxCoordFactory

Defines an atmosphere sigma coordinate factory with the formula: p = ptop + sigma * (ps - ptop)

Creates an atmosphere sigma coordinate factory with the formula:

p(n, k, j, i) = pressure_at_top + sigma(k) *

(surface_air_pressure(n, j, i) - pressure_at_top)

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Return dependencies.

class iris.aux_factory.AuxCoordFactory[source]#

Bases: CFVariableMixin

Represents a “factory” which can manufacture an additional auxiliary coordinate on demand, by combining the values of other coordinates.

Each concrete subclass represents a specific formula for deriving values from other coordinates.

The standard_name, long_name, var_name, units, attributes and coord_system of the factory are used to set the corresponding properties of the resulting auxiliary coordinates.

derived_dims(coord_dims_func)[source]#

Returns the cube dimensions for the derived coordinate.

Args:

Returns:

A sorted list of cube dimension numbers.

abstract make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

update(old_coord, new_coord=None)[source]#

Notifies the factory of the removal/replacement of a coordinate which might be a dependency.

Args:

  • old_coord:

    The coordinate to be removed/replaced.

  • new_coord:

    If None, any dependency using old_coord is removed, otherwise any dependency using old_coord is updated to use new_coord.

updated(new_coord_mapping)[source]#

Creates a new instance of this factory where the dependencies are replaced according to the given mapping.

Args:

  • new_coord_mapping:

    A dictionary mapping from the object IDs potentially used by this factory, to the coordinate objects that should be used instead.

xml_element(doc)[source]#

Returns a DOM element describing this coordinate factory.

property climatological#

Always returns False, as a factory itself can never have points/bounds and therefore can never be climatological by definition.

property coord_system#

The coordinate-system (if any) of the coordinate made by the factory.

abstract property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.HybridHeightFactory(delta=None, sigma=None, orography=None)[source]#

Bases: AuxCoordFactory

Defines a hybrid-height coordinate factory with the formula:

z = a + b * orog

Creates a hybrid-height coordinate factory with the formula:

z = a + b * orog

At least one of delta or orography must be provided.

Args:

  • delta: Coord

    The coordinate providing the a term.

  • sigma: Coord

    The coordinate providing the b term.

  • orography: Coord

    The coordinate providing the orog term.

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

update(old_coord, new_coord=None)[source]#

Notifies the factory of the removal/replacement of a coordinate which might be a dependency.

Args:

  • old_coord:

    The coordinate to be removed/replaced.

  • new_coord:

    If None, any dependency using old_coord is removed, otherwise any dependency using old_coord is updated to use new_coord.

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.HybridPressureFactory(delta=None, sigma=None, surface_air_pressure=None)[source]#

Bases: AuxCoordFactory

Defines a hybrid-pressure coordinate factory with the formula:

p = ap + b * ps

Creates a hybrid-height coordinate factory with the formula:

p = ap + b * ps

At least one of delta or surface_air_pressure must be provided.

Args:

  • delta: Coord

    The coordinate providing the ap term.

  • sigma: Coord

    The coordinate providing the b term.

  • surface_air_pressure: Coord

    The coordinate providing the ps term.

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.OceanSFactory(s=None, eta=None, depth=None, a=None, b=None, depth_c=None)[source]#

Bases: AuxCoordFactory

Defines an Ocean s-coordinate factory.

Creates an Ocean s-coordinate factory with the formula:

z(n,k,j,i) = eta(n,j,i)*(1+s(k)) + depth_c*s(k) +

(depth(j,i)-depth_c)*C(k)

where:
C(k) = (1-b) * sinh(a*s(k)) / sinh(a) +

b * [tanh(a * (s(k) + 0.5)) / (2 * tanh(0.5*a)) - 0.5]

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.OceanSg1Factory(s=None, c=None, eta=None, depth=None, depth_c=None)[source]#

Bases: AuxCoordFactory

Defines an Ocean s-coordinate, generic form 1 factory.

Creates an Ocean s-coordinate, generic form 1 factory with the formula:

z(n,k,j,i) = S(k,j,i) + eta(n,j,i) * (1 + S(k,j,i) / depth(j,i))

where:

S(k,j,i) = depth_c * s(k) + (depth(j,i) - depth_c) * C(k)

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.OceanSg2Factory(s=None, c=None, eta=None, depth=None, depth_c=None)[source]#

Bases: AuxCoordFactory

Defines an Ocean s-coordinate, generic form 2 factory.

Creates an Ocean s-coordinate, generic form 2 factory with the formula:

z(n,k,j,i) = eta(n,j,i) + (eta(n,j,i) + depth(j,i)) * S(k,j,i)

where:
S(k,j,i) = (depth_c * s(k) + depth(j,i) * C(k)) /

(depth_c + depth(j,i))

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.OceanSigmaFactory(sigma=None, eta=None, depth=None)[source]#

Bases: AuxCoordFactory

Defines an ocean sigma coordinate factory.

Creates an ocean sigma coordinate factory with the formula:

z(n, k, j, i) = eta(n, j, i) + sigma(k) *

(depth(j, i) + eta(n, j, i))

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.

class iris.aux_factory.OceanSigmaZFactory(sigma=None, eta=None, depth=None, depth_c=None, nsigma=None, zlev=None)[source]#

Bases: AuxCoordFactory

Defines an ocean sigma over z coordinate factory.

Creates an ocean sigma over z coordinate factory with the formula:

if k < nsigma:
z(n, k, j, i) = eta(n, j, i) + sigma(k) *

(min(depth_c, depth(j, i)) + eta(n, j, i))

if k >= nsigma:

z(n, k, j, i) = zlev(k)

The zlev and ‘nsigma’ coordinates must be provided, and at least either eta, or ‘sigma’ and depth and depth_c coordinates.

make_coord(coord_dims_func)[source]#

Returns a new iris.coords.AuxCoord as defined by this factory.

Args:

property dependencies#

Returns a dictionary mapping from constructor argument names to the corresponding coordinates.