uxarray.Grid.compute_face_areas#
- Grid.compute_face_areas(quadrature_rule='triangular', order=4, latitude_adjusted_area=False, return_jacobian=False, as_uxarray=False)#
Compute the area of each face in the grid.
Unlike the cached
face_areasproperty (which always uses the default quadrature), this method computes areas with a caller-specified quadrature rule and order. For repeated access with default settings, prefer theface_areasproperty, which caches its result.- Parameters:
quadrature_rule (str, optional) –
Quadrature rule used to integrate each face, one of:
"triangular"(default): symmetric quadrature over each spherical sub-triangle; supported orders are 1, 4, 8, 10, 12."gaussian": tensor-product Gauss-Legendre quadrature; supported orders are 1 to 10.
A quadrature rule is the set of sample points and weights used to numerically approximate the surface integral; a higher order uses more points for a more accurate area at greater cost.
order (int, optional) – Order of the quadrature rule. Defaults to 4.
latitude_adjusted_area (bool, optional) – If True, corrects the area of faces that have edges lying along a line of constant latitude (a small-circle edge encloses slightly more area than the great-circle arc between the same endpoints). Defaults to False.
return_jacobian (bool, optional) – If True, also return the per-face Jacobian of the integration. Defaults to False.
as_uxarray (bool, optional) – If True, return the areas as a
UxDataArraypaired with this grid (result.uxgrid = self), so the result can be plotted directly, instead of a rawnumpy.ndarray. Defaults to False.
- Returns:
numpy.ndarray or uxarray.UxDataArray – Area of each face, shape
(n_face,). Returned as aUxDataArraywhenas_uxarray=True.numpy.ndarray – Per-face Jacobian, only returned when
return_jacobian=True.
Notes
This method performs geometric integration. For HEALPix grids this may not preserve the equal-area property, since it integrates the polygonal face representation rather than the theoretical pixel areas; use the
face_areasproperty for HEALPix equal areas.