FieldMetadata#
- class fridom.framework.field_metadata.FieldMetadata(name: str = 'unnamed', long_name: str = 'Unnamed', units: str = 'n/a', nc_attrs: dict | None = None, is_spectral: bool = False, _topo: tuple[bool] | None = None, position: ~fridom.framework.grid.position.Position | None = None, _bc_types: tuple[~fridom.framework.grid.boundary_type.BCType] | None = None, _flags: dict = <factory>)[source]#
Bases:
objectMetadata for the ScalarField.
Description#
The FieldMetadata class contains all metadata for the ScalarField. This includes the name, long name, units, and additional attributes for the NetCDF file or xarray. The metadata also contains information about the position of the ScalarField on the grid, the topology, and the boundary conditions.
Parameters#
- namestr (default “unnamed”)
Name of the ScalarField
- long_namestr (default “Unnamed”)
Long name of the ScalarField
- unitsstr (default “n/a”)
Units of the ScalarField
- nc_attrsdict | None (default None)
Additional attributes for the NetCDF file or xarray
- is_spectralbool (default False)
True if the ScalarField should be initialized in spectral space
- topolist[bool] | None (default None)
Topology of the ScalarField. If None, the ScalarField is assumed to be fully extended in all directions. If a list of booleans is given, the ScalarField has no extend in the directions where the corresponding entry is False.
- positionfr.grid.Position | None (default None)
Position of the ScalarField on the grid
- bc_typestuple[BCType] | None (default None)
Tuple of BCType objects that specify the type of boundary condition in each direction. If None, the default boundary conditions is Neumann.
- _flagsdict (default {“NO_ADV”: False,
“ENABLE_MIXING”: False, “ENABLE_FRICTION”: False})
Dictionary with flag options for the ScalarField
- __init__(name: str = 'unnamed', long_name: str = 'Unnamed', units: str = 'n/a', nc_attrs: dict | None = None, is_spectral: bool = False, _topo: tuple[bool] | None = None, position: ~fridom.framework.grid.position.Position | None = None, _bc_types: tuple[~fridom.framework.grid.boundary_type.BCType] | None = None, _flags: dict = <factory>) None#
Methods
__init__([name, long_name, units, nc_attrs, ...])copy()Create a deep copy of the FieldMetadata.
from_serializable(data)Create a FieldMetadata object from a serializable dictionary.
set_default(mset)Set None values to default values.
Convert the FieldMetadata to a serializable dictionary.
Attributes
The boundary condition types for the ScalarField.
Dictionary with flag options for the ScalarField.
The topology of the Scalar Field.
- name: str = 'unnamed'#
- long_name: str = 'Unnamed'#
- units: str = 'n/a'#
- nc_attrs: dict | None = None#
- is_spectral: bool = False#
- set_default(mset: ModelSettingsBase) None[source]#
Set None values to default values.
- copy() FieldMetadata[source]#
Create a deep copy of the FieldMetadata.
- classmethod from_serializable(data: dict) FieldMetadata[source]#
Create a FieldMetadata object from a serializable dictionary.
- property topo: tuple[bool]#
The topology of the Scalar Field.
Description#
The topology of a scalar field determines whether the field lives in a certain direction. If the topology is True in a direction, the field is fully extended in this direction, if it is False, the field has no extend in this direction.
- property flags: dict#
Dictionary with flag options for the ScalarField.