Skip to content

Observation point files

Observation point files come in two flavours:

Observation point .ini files

The obs module provides the specific logic for accessing observation point .ini files for a D-Flow FM model.

Generic parsing and serializing functionality comes from the generic hydrolib.core.dflowfm.ini modules.

An observation point .ini file is described by the classes below.

Model

ObservationPoint (INIBasedModel) pydantic-model

An observation point that is included in the observation point file.

All lowercased attributes match with the observation point input as described in UM Sec.F.2.2.1.

validate_that_location_specification_is_correct(values: Dict) -> Dict classmethod

Validates that the correct location specification is given.

Source code in hydrolib/core/dflowfm/obs/models.py
@root_validator(allow_reuse=True)
def validate_that_location_specification_is_correct(cls, values: Dict) -> Dict:
    """Validates that the correct location specification is given."""
    return validate_location_specification(
        values,
        config=LocationValidationConfiguration(
            validate_node=False, validate_num_coordinates=False
        ),
        fields=LocationValidationFieldNames(x_coordinates="x", y_coordinates="y"),
    )

ObservationPointGeneral (INIGeneral) pydantic-model

The observation point file's [General] section with file meta data.

ObservationPointModel (INIModel) pydantic-model

The overall observation point model that contains the contents of one observation point file.

This model is typically referenced under a FMModel.output.obsfile[..].

Attributes:

Name Type Description
general ObservationPointGeneral

[General] block with file metadata.

observationpoint List[ObservationPoint]

List of [ObservationPoint] blocks for all observation points.

Legacy observation point .xyn files

The xyn module provides the specific logic for accessing legacy observation point files for a D-Flow FM model.

An observation point .xyn file is described by the classes below.

Model

XYNModel (ParsableFileModel) pydantic-model

Observation station (.xyn) file.

dict(self, *args, **kwargs)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Source code in hydrolib/core/dflowfm/xyn/models.py
def dict(self, *args, **kwargs):
    # speed up serializing by not converting these lowest models to dict
    return dict(points=self.points)

XYNPoint (BaseModel) pydantic-model

Single XYN point, representing a named station location.

Back to top