hydroflows.methods.sfincs.sfincs_downscale#

Downscale SFINCS simulated waterlevels to high res water depths.

class hydroflows.methods.sfincs.sfincs_downscale.SfincsDownscale(sfincs_map: Path, sfincs_subgrid_dep: Path, event_name: str | None = None, output_root: Path | None = None, **params)[source]#

Downscale SFINCS simulated waterlevels to high res water depths.

output tif file is saved to {output_root}/hmax_{event_name}.tif

Parameters:
  • sfincs_map (Path) – The path to the SFINCS model output sfincs_map.nc file.

  • sfincs_subgrid_dep (Path) – The path to the highres dem file to use for downscaling the results.

  • event_name (str) – The name of the event, used to create the output filename.

  • output_root (Optional[Path], optional) – The output directory where the hazard output files are saved. By default the output is saved in the same directory as the input.

  • **params – Additional parameters to pass to the SfincsDownscale instance. See sfincs_downscale Params.

pydantic model hydroflows.methods.sfincs.sfincs_downscale.Input[source]#

Input parameters for the SfincsDownscale 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 sfincs_map: Annotated[Path, AfterValidator(func=filedir_validator)] [Required]#

The path to the SFINCS model output sfincs_map.nc file.

field sfincs_subgrid_dep: Path [Required]#

The path to the highres dem file to use for downscaling the results.

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.sfincs.sfincs_downscale.Output[source]#

Output parameters for the SfincsDownscale 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 hazard_tif: Path [Required]#

The path to the output inundation raster geotiff.

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.sfincs.sfincs_downscale.Params[source]#

Parameters for the SfincsDownscale 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 depth_min: float = 0.05#

Minimum depth to consider as “flooding.

field event_name: str [Required]#

The name of the event, used to create the output filename.

field output_root: Annotated[Path, AfterValidator(func=outputdirpath_validator)] | None = None#

The path to the root directory where the hazard output files are saved.

field raster_kwargs: <lambda>, json_schema_input_type=PydanticUndefined)] = {}#

Kwargs to pass to writer of inundation raster.

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.