uxarray.Grid.from_points#
- classmethod Grid.from_points(points, method='spherical_delaunay', boundary_points=None, **kwargs)#
Create a grid from unstructured points.
This class method generates connectivity information based on the provided points. Depending on the chosen method, it constructs either a spherical Voronoi diagram or a spherical Delaunay triangulation. When using the Delaunay method, boundary_points can be specified to exclude triangles that span over defined holes in the data.
- Parameters:
points (sequence of array-like) –
The input points to generate connectivity from.
If len(points) == 2, points should be [longitude, latitude] in degrees, where each is an array-like of shape (N,).
If len(points) == 3, points should be [x, y, z] coordinates, where each is an array-like of shape (N,).
method (str, optional) –
The method to generate connectivity information. Supported methods are:
’spherical_voronoi’: Constructs a spherical Voronoi diagram.
’spherical_delaunay’: Constructs a spherical Delaunay triangulation.
’regional_delaunay’: Constructs a regional Delaunay triangulation.
Default is ‘spherical_delaunay’.
boundary_points (array-like of int, optional) –
Indices of points that lie on a defined boundary. These are used to exclude Delaunay triangles that span over holes in the data. This parameter is only applicable when method is ‘spherical_delaunay’.
Default is None.
**kwargs – Additional keyword arguments to pass to the underlying connectivity generation functions (_spherical_voronoi_from_points or _spherical_delaunay_from_points).
- Returns:
An instance of a Grid created from the points
- Return type: