esmf_regrid.experimental.unstructured_regrid module#
Provides ESMF
representations of UGRID meshes.
- class esmf_regrid.experimental.unstructured_regrid.MeshInfo(node_coords, face_node_connectivity, node_start_index, elem_start_index=0, areas=None, elem_coords=None, location='face')[source]#
Bases:
SDO
Class for handling unstructured meshes.
This class holds information about Meshes in a form similar to UGRID. It contains methods for translating this information into
ESMF
objects. In particular, there are methods for representing as anESMF.api.mesh.Mesh
and as anESMF.api.field.Field
containing thatMesh
. This ESMFField
is designed to contain enough information for area weighted regridding and may be inappropriate for otherESMF
regridding schemes.Create a
MeshInfo
object describing a UGRID-like mesh.- Parameters
node_coords (
ArrayLike
) – AnNx2
array describing the location of the nodes of the mesh.node_coords[:,0]
describes the longitudes in degrees andnode_coords[:,1]
describes the latitudes in degrees.face_node_connectivity (
ArrayLike
) – A masked array describing the face node connectivity of the mesh. The unmasked points offace_node_connectivity[i]
describe which nodes are connected to thei
’th face.node_start_index (int) – A value which, appearing in the
face_node_connectivity
array, indicates the first node in thenode_coords
array. UGRID supports both0
based and1
based indexing, so both must be accounted for here: https://ugrid-conventions.github.io/ugrid-conventions/#zero-or-oneelem_start_index (int, default=0) – Describes what index should be considered by
ESMF
to be the start index for describing its elements. This makes no difference to the regridding calculation and will only affect the intermediateESMF
objects, should the user need access to them.areas (
ArrayLike
, optional) – Array describing the areas associated with each face. IfNone
, thenESMF
will use its own calculated areas.elem_coords (
ArrayLike
, optional) – AnNx2
array describing the location of the face centers of the mesh.elem_coords[:,0]
describes the longitudes in degrees andelem_coords[:,1]
describes the latitudes in degrees.location (str, default="face") – Either “face” or “node”. Describes the location for data on the mesh.