pvtend.sh_ops.helmholtz_sh
- pvtend.sh_ops.helmholtz_sh(u: ndarray, v: ndarray, lat: ndarray, lon: ndarray, R_earth: float = 6371000.0, return_harmonic: bool = True, sanity_tol: float = 0.001) dict[source]
Spherical-harmonic Helmholtz decomposition.
On the full sphere a Helmholtz decomposition into rotational and divergent parts is exact, so the harmonic residual is zero up to floating-point error. We still report
u_har/v_harfor API parity with the FD path. NH-only inputs are mirrored with parity (u even, v odd) so the equator becomes a hard wall and the harmonic residual remains negligible inside the NH.- Parameters:
u – Zonal wind, shape
(nlat, nlon).v – Meridional wind, shape
(nlat, nlon).lat – Latitudes in degrees, ascending.
lon – Longitudes in degrees in [0, 360).
R_earth – Earth radius in metres.
return_harmonic – If True, also return the (numerical-residual) harmonic part.
sanity_tol – Warn if
‖u_har‖ / ‖u‖ > sanity_tolon a global input. Disabled for NH-only inputs (the equator wall generates an expected boundary residual).
- Returns:
Dict with the same keys as
pvtend.helmholtz.helmholtz_decomposition().