ILAMB.Variable.Variable.integrateInDepth

Variable.integrateInDepth(**keywords)[source]

Integrates the variable over a given layer limits.

Uses nodal integration to integrate to approximate

\[\int_{z_0}^{z_f} v(z,\dots)\ dz\]

The arguments of the integrand reflect that while it must be at least defined in depth, the remaining arguments are flexible. If \(z_0\) or \(z_f\) are not specified, the variable will be integrated over the extent of its depth domain. If the mean function value over depth is desired, this routine will approximate

\[\frac{1}{z_f-z_0} \int_{z_0}^{z_f} v(z,\dots)\ dz\]

again by nodal integration. The amount of depth which we divide by is the non-masked amount of depth. This means that if a function has some values masked or marked as invalid, we do not penalize the average value by including this as a depth at which data is expected.

Parameters
  • z0 (float, optional) – initial depth in m

  • zf (float, optional) – final depth in m

  • mean (boolean, optional) – enable to divide the integrand to get the mean function value

Returns

integral – a Variable instance with the integrated value along with the appropriate name and unit change

Return type

ILAMB.Variable.Variable