hydroflows.methods.hazard_validation.floodmarks#

Validate simulated hazard based on floodmarks.

class hydroflows.methods.hazard_validation.floodmarks.FloodmarksValidation(floodmarks_geom: Path, flood_hazard_map: Path, waterlevel_col: str, waterlevel_unit: Literal['m', 'cm', 'mm', 'ft', 'in'], out_root: Path = PosixPath('data/validation'), **params)[source]#

Validate simulated hazard based on floodmarks.

Parameters:
  • floodmarks_geom (Path) – Path to the geometry file (shapefile, GeoJSON or GeoPackage) with floodmark locations as points. The corresponding water levels are defined by the property specified in waterlevel_col.

  • flood_hazard_map (Path) – The file path to the flood hazard map to be used for validation.

  • out_root (Path, optional) – The root folder to save the derived validation scores, by default “data/validation”.

  • waterlevel_col (Str) – The property name for the observed water levels in the floodmarks geometry file

  • waterlevel_unit (Literal["m", "cm", "mm", "ft", "in"]) – Obsevred floodmarks unit. Valid options are ‘m’ for meters, ‘cm’ for centimeters, ‘ft’ for feet and ‘in’ for inches .

  • **params – Additional parameters to pass to the FloodmarksValidation instance.

See also

FloodmarksValidation Input FloodmarksValidation Output FloodmarksValidation Params

pydantic model hydroflows.methods.hazard_validation.floodmarks.Input[source]#

Input parameters for the FloodmarksValidation method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field flood_hazard_map: Path [Required]#

The file path to the flood hazard map to be used for validation, provided in TIFF format.

field floodmarks_geom: Path [Required]#

The file path to a geometry file (e.g. shapefile, GeoJSON, GeoPackage etc.) containing the locations of floodmarks as points. This file should include an attribute/property representing the corresponding water levels at each location.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model hydroflows.methods.hazard_validation.floodmarks.Output[source]#

Output parameters for the FloodmarksValidation method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field validation_scores_csv: Path [Required]#

The path to the CSV file with the derived validation scores.

field validation_scores_geom: Path [Required]#

The path to the geometry file with the derived validation scores.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model hydroflows.methods.hazard_validation.floodmarks.Params[source]#

Parameters for FloodmarksValidation method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field bins: <lambda>, json_schema_input_type=PydanticUndefined)] = None#

Custom bin edges for categorizing the the difference between observed and simulated values. If None (default), calculated based on nbins, vmin and vmax.

field bmap: str = None#

Background map souce name, by default None Default image tiles “sat”, and “osm” are fetched from cartopy image tiles. If contextily is installed, xyzproviders tiles can be used as well.

field cmap: str = 'bwr'#

Colormap used for visualizing the difference (observed - simulated) values. Default is ‘bwr’ (blue-white-red).

field figsize: <lambda>, json_schema_input_type=PydanticUndefined)] = (12, 7)#

Figure size, by default (12,7).

field filename: str = 'validation_scores_floodmarks.csv'#

The filename for the produced validation scores csv file.

field nbins: Annotated[int, Gt(gt=0)] = 5#

Number of bins for grouping the difference between observed and simulated values (for color mapping).

field out_root: Annotated[Path, AfterValidator(func=outputdirpath_validator)] [Required]#

Root folder to save the derived validation scores.

field plot_fig: bool = True#

Determines whether to plot a figure, with the derived validation scores and the difference between observed and simulated values with color bins geographically.

field region: Path = None#

File path to the geometry file representing the area used for hazard simulation. This is only used for visualization pursposes. An example of this file could be a GeoJSON of the SFINCS region.

field vmax: float | int = None#

Maximum value for the color scale. If None (default), the maximum value of difference (observed - simulated) is used.

field vmin: float | int = None#

Minimum value for the color scale. If None (default), the (rounded) minimum value of difference (observed - simulated) is used.

field waterlevel_col: str [Required]#

The column/attribute name representing the observed water level in the input floodmarks geometry file, as provided in the Input class.

field waterlevel_unit: Literal['m', 'cm', 'mm', 'ft', 'in'] [Required]#

The unit (length) of the observed floodmarks in the input geometry file, as provided in the Input class. Valid options are ‘m’ for meters , ‘cm’ for centimeters, “mm” for milimeters, “ft” for feet and “in” for inches.

field zoomlevel: str = 'auto'#

Zoomlevel, by default ‘auto’.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.