hydromodpy.spatial.field.geology.geology_field#

Geology spatial field for heterogeneous parameter mapping on simulation meshes.

Purpose#

This module defines GeologyField, a concrete implementation of the generic Field interface based on geology classes (typically read from raster data). Its role is to convert raw geology support into reusable spatial fractions on a target mesh.

Pipeline in the field framework#

  1. Build GeologyField from encoded grid data.

  2. Call on_mesh(mesh) to obtain per-cell fractions of geology zones.

  3. Pass the returned discretization to FieldParam(kind="heterogeneous", values_by_key=...).

  4. FieldParam.to_mesh_field(...) computes one numerical value per mesh cell using weighted aggregation.

Design choice#

The geometry and the physical values are intentionally separated:

  • GeologyField handles where zones are located.

  • FieldParam handles which value each zone receives.

This allows:

  • reusing the same geology support for multiple calibrated variables (for example K, Sy, porosity),

  • changing parameter values without recomputing geometry logic.

Classes

GeologyField(*, identifier, encoded_codes, ...)

Geology-driven implementation of the generic spatial Field interface.