ILAMB.Variable.Variable.integrateInTime

Variable.integrateInTime(**keywords)[source]

Integrates the variable over a given time period.

Uses nodal integration to integrate to approximate

\[\int_{t_0}^{t_f} v(t,\dots)\ dt\]

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

\[\frac{1}{t_f-t_0} \int_{t_0}^{t_f} v(t,\dots)\ dt\]

again by nodal integration. The amount of time which we divide by is the non-masked amount of time. 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 time at which data is expected.

Parameters
  • t0 (float, optional) – initial time in days since 1/1/1850

  • tf (float, optional) – final time in days since 1/1/1850

  • 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