hkayabilisim
commited on
Commit
•
3d54db9
1
Parent(s):
2442da6
Changed rules in height adjustment, damage cap etc.
Browse filesBased on Vibek's suggestion on 2024-02-06:
* Damage cap feature is removed as this functionaliy is only meant for monetary
calculations which we don't do here.
* Nairobi patch is limited to Africa.
* In addition to Adb, Nairobi patch is also applied to StMin and BrM structures.
* Height adjustment is not applied to single-storey buildigs.
app.py
CHANGED
@@ -10,13 +10,19 @@ info_text = """
|
|
10 |
This interface is prepared to visualize the flood damage functions defined by JRC and generate flood vulnerability file that can be used in [Tomorrow's Cities Decision Support Environment Web App](https://github.com/TomorrowsCities/tomorrowscities). The raw damage curves are borrowed from [JRC Global Flood Depth Damage Function Database](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC105688/copy_of_global_flood_depth-damage_functions__30102017.xlsx). The following adjustments are done in order:
|
11 |
* The occupancy types of ResCom, Edu, or Hea are not defined in JRC database. Therefore, for these types, occupancy type is assumed to be Com.
|
12 |
* If there is no damage curve defined in JRC for specific continent/occupancy pair, then Global damage curve is used. For instance, there is no curve for commercial (Com) buildings in Africa. In this case, the Global curve for Com is used. See "Damage functions" tab in [JRC Global Flood Depth Damage Function Database](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC105688/copy_of_global_flood_depth-damage_functions__30102017.xlsx).
|
13 |
-
* Height adjustment: the damage value is multiplied by 2/(number of storeys)
|
14 |
-
*
|
15 |
-
* "Nairobi Patch": when selected, the program uses the Type I curve in [Englhardt et al 2019](https://nhess.copernicus.org/articles/19/1703/2019/nhess-19-1703-2019.pdf) for weak structures and single-storey buildings. It also disables height modifier. Maximum damage cap still holds.
|
16 |
|
17 |
To see the original JRC curves as well as the adjusted versions, play with the continent, occupancy, typology, code level, and number of storeys. The interface will plot original JRC damage curves as well as the adjusted curves. Please notice that code level will not have an effect on damage curves.
|
18 |
|
19 |
If you would like to generate an excel file containing all adjusted damage functions for all possible combinations except the continent, please click "Generate" button. You will be able to download the continent-specific vulnerability file and use it directly in the [Web App]((https://github.com/TomorrowsCities/tomorrowscities).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
"""
|
21 |
|
22 |
# All code levels defined in our codebase
|
@@ -79,14 +85,9 @@ damage_functions = {
|
|
79 |
# Most common (mode) number of storeys within the JRC empirical data (Asia, Residential)
|
80 |
most_common_nstories = 2
|
81 |
|
82 |
-
# Typology-based adjustment factor defined in our project
|
83 |
-
max_damage_adjustment_factor = {
|
84 |
-
'Adb': 0.6,
|
85 |
-
'RCi': 0.6,
|
86 |
-
'StMin': 0.6}
|
87 |
-
|
88 |
# Type I typologies in Figure 2 of Englhardt et al 2019.
|
89 |
typeI_typologies= ['Adb','Erth','Inf','M','Re','Wwd']
|
|
|
90 |
|
91 |
# Digitized on JRC flood depths
|
92 |
typeI_damage_function = [0,0.49,0.91,1.00,1.00,1.00,1.00,1.00,1]
|
@@ -102,23 +103,20 @@ def get_damage_function(continent, occupancy, typology, code_level, nstoreys, na
|
|
102 |
|
103 |
rel_damage = jrc_damage.copy()
|
104 |
|
105 |
-
height_adjustment_factor = 2.0/nstoreys
|
106 |
|
107 |
# Applying Type I in Figure 2 of Englhardt et al 2019.
|
108 |
if nairobi_patch:
|
109 |
-
if typology in typeI_typologies and nstoreys == 1:
|
110 |
rel_damage = typeI_damage_function
|
111 |
height_adjustment_factor = 1
|
112 |
|
113 |
-
|
114 |
-
max_damage = max_damage_adjustment_factor[typology]
|
115 |
-
else:
|
116 |
-
max_damage = 1
|
117 |
|
118 |
# Create adjuste damage function
|
119 |
rel_damage_adjusted = rel_damage.copy()
|
120 |
for idx, damage in enumerate(rel_damage):
|
121 |
-
rel_damage_adjusted[idx] = min(
|
122 |
|
123 |
return jrc_damage, rel_damage_adjusted
|
124 |
|
@@ -184,8 +182,8 @@ with gd.Blocks() as demo:
|
|
184 |
label='Number of storeys')
|
185 |
nairobi_patch = gd.Checkbox(value=False,
|
186 |
label='Apply Nairobi Patch',
|
187 |
-
info="""If the typology is of weak-type
|
188 |
-
|
189 |
Type I data in Figure 2 of Englhardt et al 2019.
|
190 |
""")
|
191 |
plot = gd.Plot()
|
|
|
10 |
This interface is prepared to visualize the flood damage functions defined by JRC and generate flood vulnerability file that can be used in [Tomorrow's Cities Decision Support Environment Web App](https://github.com/TomorrowsCities/tomorrowscities). The raw damage curves are borrowed from [JRC Global Flood Depth Damage Function Database](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC105688/copy_of_global_flood_depth-damage_functions__30102017.xlsx). The following adjustments are done in order:
|
11 |
* The occupancy types of ResCom, Edu, or Hea are not defined in JRC database. Therefore, for these types, occupancy type is assumed to be Com.
|
12 |
* If there is no damage curve defined in JRC for specific continent/occupancy pair, then Global damage curve is used. For instance, there is no curve for commercial (Com) buildings in Africa. In this case, the Global curve for Com is used. See "Damage functions" tab in [JRC Global Flood Depth Damage Function Database](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC105688/copy_of_global_flood_depth-damage_functions__30102017.xlsx).
|
13 |
+
* Height adjustment: the damage value is multiplied by 2/(number of storeys) when number of storeys is greater than one.
|
14 |
+
* "Nairobi Patch": when selected, the program uses the Type I curve in [Englhardt et al 2019](https://nhess.copernicus.org/articles/19/1703/2019/nhess-19-1703-2019.pdf) for weak structures (Adb, StMin, BrM) and single-storey buildings in Africa.
|
|
|
15 |
|
16 |
To see the original JRC curves as well as the adjusted versions, play with the continent, occupancy, typology, code level, and number of storeys. The interface will plot original JRC damage curves as well as the adjusted curves. Please notice that code level will not have an effect on damage curves.
|
17 |
|
18 |
If you would like to generate an excel file containing all adjusted damage functions for all possible combinations except the continent, please click "Generate" button. You will be able to download the continent-specific vulnerability file and use it directly in the [Web App]((https://github.com/TomorrowsCities/tomorrowscities).
|
19 |
+
|
20 |
+
## Changelog
|
21 |
+
**2024-02-06** (based on Vibek's feedback)
|
22 |
+
* Damage cap feature is removed as this functionaliy is only meant for monetary calculations which we don't do here.
|
23 |
+
* Nairobi patch is limited to Africa.
|
24 |
+
* In addition to Adb, Nairobi patch is also applied to StMin and BrM structures.
|
25 |
+
* Height adjustment is not applied to single-storey buildigs.
|
26 |
"""
|
27 |
|
28 |
# All code levels defined in our codebase
|
|
|
85 |
# Most common (mode) number of storeys within the JRC empirical data (Asia, Residential)
|
86 |
most_common_nstories = 2
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
# Type I typologies in Figure 2 of Englhardt et al 2019.
|
89 |
typeI_typologies= ['Adb','Erth','Inf','M','Re','Wwd']
|
90 |
+
weak_typologies = ['Adb','StMin','BrM']
|
91 |
|
92 |
# Digitized on JRC flood depths
|
93 |
typeI_damage_function = [0,0.49,0.91,1.00,1.00,1.00,1.00,1.00,1]
|
|
|
103 |
|
104 |
rel_damage = jrc_damage.copy()
|
105 |
|
106 |
+
height_adjustment_factor = 2.0/nstoreys if nstoreys > 1 else 1
|
107 |
|
108 |
# Applying Type I in Figure 2 of Englhardt et al 2019.
|
109 |
if nairobi_patch:
|
110 |
+
if typology in typeI_typologies + weak_typologies and nstoreys == 1 and continent == 'Africa':
|
111 |
rel_damage = typeI_damage_function
|
112 |
height_adjustment_factor = 1
|
113 |
|
114 |
+
max_damage = 1
|
|
|
|
|
|
|
115 |
|
116 |
# Create adjuste damage function
|
117 |
rel_damage_adjusted = rel_damage.copy()
|
118 |
for idx, damage in enumerate(rel_damage):
|
119 |
+
rel_damage_adjusted[idx] = min(height_adjustment_factor * damage, max_damage)
|
120 |
|
121 |
return jrc_damage, rel_damage_adjusted
|
122 |
|
|
|
182 |
label='Number of storeys')
|
183 |
nairobi_patch = gd.Checkbox(value=False,
|
184 |
label='Apply Nairobi Patch',
|
185 |
+
info="""If the typology is of weak-type (Adb, StMin, BrM)
|
186 |
+
,the number of storeys is 1 and the continent is Africa, then use
|
187 |
Type I data in Figure 2 of Englhardt et al 2019.
|
188 |
""")
|
189 |
plot = gd.Plot()
|