Skip to content

Commit

Permalink
update vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
Santonia27 committed Nov 7, 2023
1 parent a91c2e6 commit 170b699
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/user_guide/data/vulnerability.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,13 @@ plt.gca().get_legend().set_title('')
```


The damage functions must be given in a two-column CSV file ('*vulnerability.csv*'), located in the 'vulnerability'- folder. The first column contains the water depth, and the second column the corresponding damage fraction. A header row is required, describing the unit of the water depth; `#UNIT = ['unit'] (e.g., '#UNIT = metres')`. A second column, named `'#METHOD'`, must be defined for each damage-curve separately above the Damage-Curve ID. The method refers to the nature of the damage fraction, whether it's the 'maximum' or 'mean' value. The Damage-Curve ID must coincide with the information of the damage function ID defined in the exposure data file.

Water depths may be negative for objects which have damage below the ground floor height, and the user is free to choose any water depth increments in the CSV file. The damage function CSV files can have any name the user would like to assign to them.
Multiple damage-functions can be described in one CSV file, by simply adding consecutive columns next to one another.

::: {.callout-tip}
You can also create damage functions with the [**HydroMT-FIAT model builder**](https://deltares.github.io/hydromt_fiat/latest/#).
:::

::: {.callout-important}
Water depth units (e.g. feet or meters) must be consistent with the units of the flood hazard map and the exposure data (ground elevation, ground floor height).
:::

The `vulnerability.csv` is built upon the structure in the table below. The upper two rows in the `.csv`-file define the unit and the method. The damage curve (STRUCT1, STRUCT2) are a function of the water depth.
The damage functions must be given in a two-column CSV file (`vulnerability.csv`), located in the [vulnerability folder](folder_structure.qmd). The first column contains the water depth, and the second column the corresponding damage fraction. A header row is required, describing the unit of the water depth; `#UNIT = ['unit'] (e.g., '#UNIT = metres')`. A second column, named `'#METHOD'`, must be defined for each damage-curve separately above the Damage-Curve ID. The method refers to the nature of the damage fraction, whether it's the 'maximum' or 'mean' value. The Damage-Curve ID must coincide with the information of the damage function ID defined in the exposure data file.


```{python}
#| echo: false
#| label: tbl-damage-curve
#| tbl-cap: "CSV vulnerability file "
import pandas as pd
from pathlib import Path
Expand All @@ -84,9 +74,21 @@ df = pd.DataFrame({
('STRUCT2','max'): data.iloc[:, 2],
})
table = df.to_html()
#table = df.to_html()
print("UNIT = metres")
print("method = mean,max")
table
#print("UNIT = metres")
#print("method = mean,max")
df
```


Water depths may be negative for objects which have damage below the ground floor height, and the user is free to choose any water depth increments in the CSV file. The damage function CSV files can have any name the user would like to assign to them.
Multiple damage-functions can be described in one CSV file, by simply adding consecutive columns next to one another.

::: {.callout-tip}
You can also create damage functions with the [**HydroMT-FIAT model builder**](https://deltares.github.io/hydromt_fiat/latest/#).
:::

::: {.callout-important}
Water depth units (e.g. feet or meters) must be consistent with the units of the flood hazard map and the exposure data (ground elevation, ground floor height).
:::

0 comments on commit 170b699

Please sign in to comment.