pvtend.sh_ops.second_derivs_sh

pvtend.sh_ops.second_derivs_sh(field: ndarray, lat: ndarray, lon: ndarray, R_earth: float = 6371000.0) Tuple[ndarray, ndarray, ndarray][source]

Second-order horizontal derivatives (f_xx, f_xy, f_yy).

Uses two successive applications of gradient_sh(), so the operator is the spectral analogue of ∇(∇f) and inherits the pole-closure of the SH transform. Mixed derivatives f_xy are not automatically symmetric on a finite truncation, but the discrepancy is at the truncation noise level (~1e-12 for ntrunc = nlat − 1).

Parameters:
  • field – Scalar field, shape (nlat, nlon).

  • lat – Latitudes in degrees, ascending.

  • lon – Longitudes in degrees.

  • R_earth – Earth radius in metres.

Returns:

Tuple (f_xx, f_xy, f_yy) each shaped like field.