FieldParam#

class hydromodpy.spatial.FieldParam(*, identifier, kind, unit=None, value=None, values_by_key=None, field_spatial_id=None, vertical_profile=None)[source]#

Bases: object

Scalar field values (homogeneous or heterogeneous), stored in SI.

unit exposes the canonical SI unit; original_unit preserves the raw user-provided unit string for round-trip introspection. vertical_profile introduces an optional depth-dependent multiplicative factor f(z).

Parameters:
to_array(*, shape=None, x=None, y=None, zone_ids=None, zone_field=None, depth=0.0)[source]#

Materialize field values as a numeric array (homogeneous = value-driven, heterogeneous = structure-driven; depth applies vertical factors).

to_mesh_field(field_discretization=None, *, mesh=None, label=None, depth=0.0)[source]#

Convert parameter values into one value per mesh cell on the planar 2D support; for a 3D tensor, stack results from multiple calls (one per depth layer).

Parameters:

label (str | None)

map_zone_ids(zone_ids)[source]#

Map one value per zone key onto a zone-id array.

as_dict()[source]#

Serialize field parameters to a plain mapping.

classmethod from_dict(config)[source]#

Build FieldParam from a plain mapping.

Required keys: id, kind. Optional: unit, values, field_spatial_id, vertical_profile.

Parameters:

config (Mapping[str, Any])

Return type:

FieldParam