torch_harmonics.distributed.DistributedQuadratureS2#
- class torch_harmonics.distributed.DistributedQuadratureS2(
- img_shape,
- grid='equiangular',
- normalize=False,
Bases:
ModuleDistributed scalar quadrature on \(S^2\) for integrating spherical fields on a latitude/longitude grid, with data and weights split across polar and azimuth communicator groups.
See also
torch_harmonics.QuadratureS2Serial counterpart with full mathematical description and parameter documentation.
- Parameters:
img_shape (Tuple[int]) – Spatial grid shape
(nlat, nlon).grid (str, optional) – Quadrature grid type (
"equiangular","legendre-gauss","lobatto","equiangular-trapezoidal"), by default"equiangular".normalize (bool, optional) – If
True, divides weights by4πto return an average instead of an integral, by defaultFalse.
- Returns:
Tensor of shape
(..., channels)containing the global integral over the last two spatial dimensions (reduced across communicator groups).- Return type:
- Raises:
ValueError – If an unknown
gridtype is provided.