Field¶
- class esmpy.api.field.Field(grid, name=None, typekind=None, staggerloc=None, meshloc=None, ndbounds=None, grid_to_field_map=None)¶
The
Fieldclass is a Python wrapper object for the ESMF Field. The individual values of all data arrays are referenced to those of the underlying Fortran ESMF object.A
Fieldrepresents a physical field, such as temperature. TheFieldclass contains distributed and discretized field data, a reference to its associated grid, and metadata. TheFieldclass stores the grid staggering for that physical field. This is the relationship of how the data array of a field maps onto a grid (e.g. one item per cell located at the cell center, one item per cell located at the NW corner, one item per cell vertex, etc.). This means that differentFieldswhich are on the same underlyingGridbut have different staggerings can share the sameGridobject without needing to replicate it multiple times.Refer to the Field Class of the ESMF Reference Manual for more information.
The following parameters are used to create a
Fieldfrom aGrid,MeshorLocStream.REQUIRED:
- :param
Grid/Mesh/LocStreamgrid: AGrid, MeshorLocStreamwith coordinates allocated on at least one stagger location.
OPTIONAL:
- Parameters:
typekind (TypeKind) – Type of the
Fielddata. IfNone, defaults toR8.staggerloc (StaggerLoc) – The stagger location of the
Fielddata, only specify this argument when using aGrid. IfNone, defaults toCENTERin 2D andCENTER_VCENTERin 3D.meshloc (MeshLoc) – The mesh location of the
Fielddata, only specify this argument when using aMeshifNone, defaults toNODE.ndbounds (tuple) – The number of entries in an extra
Fielddimension. This is represented as a single value, a list or a tuple containing the number of entries for each desired extra dimension of theField. The time dimension must be last, following Fortran indexing conventions.grid_to_field_map (ndarray) – numpy array mapping the grid dimension
Fieldindex to the field dimension index. Array length must be equal to the grid rank; uses 1-based indexing. IfNone, defaults to mapping grid indices to the first available field indices.
- property all_data¶
- property all_lower_bounds¶
- Return type:
A list of ndarrays with an entry for each local DE. (In the typical case of 1 DE per PET, this is a single-element list containing a single ndarray. For this case, see also
lower_bounds.)- Returns:
The lower bounds of the
Field.
- property all_upper_bounds¶
- Return type:
A list of ndarrays with an entry for each local DE. (In the typical case of 1 DE per PET, this is a single-element list containing a single ndarray. For this case, see also
upper_bounds.)- Returns:
The upper bounds of the
Field.
- property data¶
- property finalized¶
- Return type:
- Returns:
Indicate if the underlying ESMF memory for this object has been deallocated.
- property grid¶
- property lower_bounds¶
- Return type:
ndarray
- Returns:
The lower bounds of the
Field. (It is an error to use this property in the uncommon case where there is something other than 1 DE per PET; in that case, useall_lower_bounds.)
- property upper_bounds¶
- Return type:
ndarray
- Returns:
The upper bounds of the
Field. (It is an error to use this property in the uncommon case where there is something other than 1 DE per PET; in that case, useall_upper_bounds.)
- get_area()¶
Initialize an existing
Fieldwith the areas of the cells of the underlyingGridorMesh.
- :param