pvtend.ddt

pvtend.ddt(field: ndarray, dt_s: float) ndarray[source]

Time derivative ∂f/∂t via centred differences.

Uses centred differences in the interior (second-order accurate) and second-order one-sided stencils at the first and last time steps when nt >= 3, matching numpy.gradient behaviour. Falls back to first-order forward/backward when nt == 2.

Parameters:
  • field – Array with time as axis 0, shape (nt, ...).

  • dt_s – Time step in seconds (assumed uniform).

Returns:

Same shape as field, in [field_units / s].