wolfhece.acceptability.acceptability

Author: University of Liege, HECE, LEMA Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

class wolfhece.acceptability.acceptability.steps_base_data_creation[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.acceptability.acceptability.steps_base_data_creation

Enum for the steps in the base data creation

CLIP_GDB = 1[source]
CLIP_CADASTER = 2[source]
CLIP_PICC = 3[source]
POINTS2POLYS = 4[source]
RASTERIZE_IGN = 5[source]
PREPROCESS_VULNCODE = 6[source]
DATABASE_TO_RASTER = 7[source]
classmethod get_list_names()[source]
class wolfhece.acceptability.acceptability.steps_vulnerability[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.acceptability.acceptability.steps_vulnerability

Enum for the steps in the vulnerability computation

CREATE_RASTERS = 1[source]
CREATE_RASTERS_VULN = 10[source]
CREATE_RASTERS_CODE = 11[source]
APPLY_MODIFS = 2[source]
MATCH_SIMUL = 3[source]
classmethod get_list_names()[source]
class wolfhece.acceptability.acceptability.steps_acceptability[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.acceptability.acceptability.steps_acceptability

Enum for the steps in the acceptability computation

COMPUTE_LOCAL_ACCEPT = 1[source]
LOAD_FROM_FILES = 2[source]
COMPUTE_MEAN_ACCEPT = 3[source]
classmethod get_list_names()[source]
wolfhece.acceptability.acceptability.Base_data_creation(main_dir: str = 'Data', Original_gdb: str = 'GT_Resilence_dataRisques202010.gdb', Study_area: str = 'Bassin_Vesdre.shp', CaPa_Walloon: str = 'Cadastre_Walloon.gpkg', PICC_Walloon: str = 'PICC_vDIFF.gdb', CE_IGN_top10v: str = 'CE_IGN_TOP10V/CE_IGN_TOP10V.shp', resolution: float = 1.0, number_procs: int = 8, steps: list[int] | list[steps_base_data_creation] = [1, 2, 3, 4, 5, 6, 7], Vuln_csv: str = 'Vulnerability.csv')[source]

Create the databse.

In this step, the following operations are performed:
  • Clip the original gdb file to the study area

  • Clip the Cadastre Walloon file to the study area

  • Clip the PICC Walloon file to the study area

  • Clip and Rasterize the IGN top10v file

  • Create the study area database with the vulnerability levels

Parameters:
  • main_dir – The main data directory

  • Original_gdb – The original gdb file from SPW - GT Resilience

  • Study_area – The study area shapefile – Data will be clipped to this area

  • CaPa_Walloon – The Cadastre Walloon file – Shapfeile from SPW

  • PICC_Walloon – The PICC Walloon file – Shapefile from SPW

  • CE_IGN_top10v – The CE “Cours d’eau” IGN top10v file – Shapefile from IGN with river layer

  • resolution – The output resolution of the raster files

  • number_procs – The number of processors to use for parallel processing

wolfhece.acceptability.acceptability.Database_to_raster(main_dir: str = 'Data', Study_area: str = 'Bassin_Vesdre.shp', resolution: float = 1.0, number_procs: int = 16, Vuln_csv: str = 'Vulnerability.csv')[source]

Convert the vector database to raster database based on their vulnerability values

Each leyer is converted to a raster file with the vulnerability values and the code values.

They are stored in the TEMP/DATABASES/StudyArea/VULNERABILITY/RASTERS in:
  • Code

  • Vulne

Parameters:
  • main_dir – The main data directory

  • Study_area – The study area shapefile

  • resolution – The resolution of the output raster files - default is 1 meter

  • number_procs – The number of processors to use for parallel processing

The parallel processing is safe as each layer is processed independently.

wolfhece.acceptability.acceptability.Vulnerability(main_dir: str = 'Data', scenario: str = 'Scenario1', Study_area: str = 'Bassin_Vesdre.shp', resolution: float = 1.0, steps: list[int] | list[steps_vulnerability] = [1, 10, 11, 2, 3], Vuln_csv: str = 'Vulnerability.csv', Intermediate_csv: str = 'Intermediate.csv')[source]

Compute the vulnerability for the study area and the scenario, if needed.

The vulnerability is computed in 3 steps:
  1. Compute the vulnerability for the study area

  2. Compute the vulnerability for the scenario

  3. Clip the vulnerability rasters to the simulation area

During step 3, three matrices are computed and clipped to the simulation area:
  • Vulnerability

  • Code

  • Masked River

Parameters:
  • main_dir – The main data directory

  • scenario – The scenario name

  • Study_area – The study area shapefile

  • resolution – The resolution of the output raster files - default is 1 meter

  • steps – The steps to compute the vulnerability - default is [1,2,3]

To be more rapid, the steps can be computed separately.
  • [1,2,3] : All steps are computed - Necessary for the first time

  • [2,3] : Only the scenario and clipping steps are computed – Useful for scenario changes

  • [3] : Only the clipping step is computed – Useful if simulation area changes but scenario is the same

wolfhece.acceptability.acceptability.Acceptability(main_dir: str = 'Vesdre', scenario: str = 'Scenario1', Study_area: str = 'Bassin_Vesdre.shp', coeff_auto: bool = True, Ponderation_csv: str = 'Ponderation.csv', resample_size: int = 100, steps: list[int] | list[steps_acceptability] = [1, 2, 3])[source]

Compute acceptability for the scenario