Skip to content

Commit

Permalink
azs - update auto_pop for E7
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarnoczay committed Dec 28, 2023
1 parent 27f1b5c commit 21c0035
Show file tree
Hide file tree
Showing 21 changed files with 844 additions and 744 deletions.
14 changes: 7 additions & 7 deletions E7HurricaneWindWater/input_data/auto_pop/FloodAssmRulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def Assm_config(BIM):
A string that identifies a specific configration within this buidling
class.
"""
year = BIM['year_built'] # just for the sake of brevity
year = BIM['YearBuilt'] # just for the sake of brevity

# Flood Type
if BIM['flood_zone'] in ['AO']:
if BIM['FloodZone'] in ['AO']:
flood_type = 'raz' # Riverline/A-Zone
elif BIM['flood_zone'] in ['AE', 'AH', 'A']:
elif BIM['FloodZone'] in ['AE', 'AH', 'A']:
flood_type = 'caz' # Costal/A-Zone
elif BIM['flood_zone'] in ['VE']:
elif BIM['FloodZone'] in ['VE']:
flood_type = 'cvz' # Costal/V-Zone
else:
flood_type = 'caz' # Default
Expand All @@ -88,18 +88,18 @@ def Assm_config(BIM):
1983, 1977, 1982, 1983, 1974, 1974, 1982, 1979, 1983, 1983,
1982, 1971, 1979]
for i in range(0,22):
PostFIRM = (((BIM['city'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM = (((BIM['City'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM)

# fl_assm
fl_assm = f"{'fl_surge_assm'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{int(PostFIRM)}_" \
f"{flood_type}"

# hu_assm
hu_assm = f"{'hu_surge_assm'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{int(PostFIRM)}"

return hu_assm, fl_assm
54 changes: 29 additions & 25 deletions E7HurricaneWindWater/input_data/auto_pop/FloodClassRulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
# Meredith Lockhead
# Tracy Kijewski-Correa

import random
import numpy as np
import datetime


def FL_config(BIM):
"""
Expand All @@ -63,23 +60,23 @@ def FL_config(BIM):
A string that identifies a specific configration within this buidling
class.
"""
year = BIM['year_built'] # just for the sake of brevity
year = BIM['YearBuilt'] # just for the sake of brevity

# Flood Type
if BIM['flood_zone'] == 'AO':
if BIM['FloodZone'] == 'AO':
flood_type = 'raz' # Riverline/A-Zone
elif BIM['flood_zone'] in ['A', 'AE']:
elif BIM['FloodZone'] in ['A', 'AE']:
flood_type = 'cvz' # Costal-Zone
elif BIM['flood_zone'].startswith('V'):
elif BIM['FloodZone'].startswith('V'):
flood_type = 'cvz' # Costal-Zone
else:
flood_type = 'cvz' # Default

# First Floor Elevation (FFE)
if flood_type in ['raz', 'caz']:
FFE = BIM['first_floor_ht1']
FFE = BIM['FirstFloorElevation']
else:
FFE = BIM['first_floor_ht1'] - 1.0
FFE = BIM['FirstFloorElevation'] - 1.0

# PostFIRM
PostFIRM = False # Default
Expand All @@ -93,15 +90,15 @@ def FL_config(BIM):
1983, 1977, 1982, 1983, 1974, 1974, 1982, 1979, 1983, 1983,
1982, 1971, 1979]
for i in range(0,22):
PostFIRM = (((BIM['city'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM = (((BIM['City'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM)

# Basement Type
if BIM['split_level'] and (BIM['fdtn_type'] == 3504):
if BIM['SplitLevel'] and (BIM['FoundationType'] == 3504):
bmt_type = 'spt' # Split-Level Basement
elif BIM['fdtn_type'] in [3501, 3502, 3503, 3505, 3506, 3507]:
elif BIM['FoundationType'] in [3501, 3502, 3503, 3505, 3506, 3507]:
bmt_type = 'bn' # No Basement
elif (not BIM['split_level']) and (BIM['fdtn_type'] == 3504):
elif (not BIM['SplitLevel']) and (BIM['FoundationType'] == 3504):
bmt_type = 'bw' # Basement
else:
bmt_type = 'bw' # Default
Expand All @@ -110,8 +107,8 @@ def FL_config(BIM):
dur = 'short'

# Occupancy Type
if BIM['occupancy_class'] == 'RES1':
if BIM['stories'] == 1:
if BIM['OccupancyClass'] == 'RES1':
if BIM['NumberOfStories'] == 1:
if flood_type == 'raz':
OT = 'SF1XA'
elif flood_type == 'cvz':
Expand All @@ -132,7 +129,7 @@ def FL_config(BIM):
OT = 'SF2SA'
elif flood_type == 'cvz':
OT = 'SF2SV'
elif 'RES3' in BIM['occupancy_class']:
elif 'RES3' in BIM['OccupancyClass']:
OT = 'APT'
else:
ap_OT = {
Expand Down Expand Up @@ -163,33 +160,40 @@ def FL_config(BIM):
'EDU1': 'SCHOOL',
'EDU2': 'SCHOOL'
}
ap_OT[BIM['occupancy_class']]
ap_OT[BIM['OccupancyClass']]


if not (BIM['occupancy_class'] in ['RES1', 'RES2']):
if 'RES3' in BIM['occupancy_class']:
if not (BIM['OccupancyClass'] in ['RES1', 'RES2']):
if 'RES3' in BIM['OccupancyClass']:
fl_config = f"{'fl'}_" \
f"{'RES3'}"
else:
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}"
elif BIM['occupancy_class'] == 'RES2':
f"{BIM['OccupancyClass']}"
elif BIM['OccupancyClass'] == 'RES2':
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{flood_type}"
else:
if bmt_type == 'spt':
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{'sl'}_" \
f"{'bw'}_" \
f"{flood_type}"
else:
st = 's'+str(np.min([BIM['stories'],3]))
st = 's'+str(np.min([BIM['NumberOfStories'],3]))
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{st}_" \
f"{bmt_type}_" \
f"{flood_type}"

# extend the BIM dictionary
BIM.update(dict(
FloodType = flood_type,
BasementType=bmt_type,
PostFIRM=PostFIRM,
))

return fl_config
53 changes: 29 additions & 24 deletions E7HurricaneWindWater/input_data/auto_pop/FloodRulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
# Meredith Lockhead
# Tracy Kijewski-Correa

import random
import numpy as np
import datetime

def FL_config(BIM):
"""
Expand All @@ -62,23 +60,23 @@ def FL_config(BIM):
A string that identifies a specific configration within this buidling
class.
"""
year = BIM['year_built'] # just for the sake of brevity
year = BIM['YearBuilt'] # just for the sake of brevity

# Flood Type
if BIM['flood_zone'] == 'AO':
if BIM['FloodZone'] == 'AO':
flood_type = 'raz' # Riverline/A-Zone
elif BIM['flood_zone'] in ['A', 'AE']:
elif BIM['FloodZone'] in ['A', 'AE']:
flood_type = 'cvz' # Costal-Zone
elif BIM['flood_zone'].startswith('V'):
elif BIM['FloodZone'].startswith('V'):
flood_type = 'cvz' # Costal-Zone
else:
flood_type = 'cvz' # Default

# First Floor Elevation (FFE)
if flood_type in ['raz', 'caz']:
FFE = BIM['first_floor_ht1']
FFE = BIM['FirstFloorElevation']
else:
FFE = BIM['first_floor_ht1'] - 1.0
FFE = BIM['FirstFloorElevation'] - 1.0

# PostFIRM
PostFIRM = False # Default
Expand All @@ -92,15 +90,15 @@ def FL_config(BIM):
1983, 1977, 1982, 1983, 1974, 1974, 1982, 1979, 1983, 1983,
1982, 1971, 1979]
for i in range(0,22):
PostFIRM = (((BIM['city'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM = (((BIM['City'] == city_list[i]) and (year > year_list[i])) or \
PostFIRM)

# Basement Type
if BIM['split_level'] and (BIM['fdtn_type'] == 3504):
if BIM['SplitLevel'] and (BIM['FoundationType'] == 3504):
bmt_type = 'spt' # Split-Level Basement
elif BIM['fdtn_type'] in [3501, 3502, 3503, 3505, 3506, 3507]:
elif BIM['FoundationType'] in [3501, 3502, 3503, 3505, 3506, 3507]:
bmt_type = 'bn' # No Basement
elif (not BIM['split_level']) and (BIM['fdtn_type'] == 3504):
elif (not BIM['SplitLevel']) and (BIM['FoundationType'] == 3504):
bmt_type = 'bw' # Basement
else:
bmt_type = 'bw' # Default
Expand All @@ -109,8 +107,8 @@ def FL_config(BIM):
dur = 'short'

# Occupancy Type
if BIM['occupancy_class'] == 'RES1':
if BIM['stories'] == 1:
if BIM['OccupancyClass'] == 'RES1':
if BIM['NumberOfStories'] == 1:
if flood_type == 'raz':
OT = 'SF1XA'
elif flood_type == 'cvz':
Expand All @@ -131,7 +129,7 @@ def FL_config(BIM):
OT = 'SF2SA'
elif flood_type == 'cvz':
OT = 'SF2SV'
elif 'RES3' in BIM['occupancy_class']:
elif 'RES3' in BIM['OccupancyClass']:
OT = 'APT'
else:
ap_OT = {
Expand Down Expand Up @@ -162,34 +160,41 @@ def FL_config(BIM):
'EDU1': 'SCHOOL',
'EDU2': 'SCHOOL'
}
ap_OT[BIM['occupancy_class']]
ap_OT[BIM['OccupancyClass']]


if not (BIM['occupancy_class'] in ['RES1', 'RES2']):
if 'RES3' in BIM['occupancy_class']:
if not (BIM['OccupancyClass'] in ['RES1', 'RES2']):
if 'RES3' in BIM['OccupancyClass']:
fl_config = f"{'fl'}_" \
f"{'RES3'}"
else:
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}"
elif BIM['occupancy_class'] == 'RES2':
f"{BIM['OccupancyClass']}"
elif BIM['OccupancyClass'] == 'RES2':
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{flood_type}"
else:
if bmt_type == 'spt':
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{'sl'}_" \
f"{'bw'}_" \
f"{flood_type}"
else:
st = 's'+str(np.min([BIM['stories'],3]))
st = 's'+str(np.min([BIM['NumberOfStories'],3]))
fl_config = f"{'fl'}_" \
f"{BIM['occupancy_class']}_" \
f"{BIM['OccupancyClass']}_" \
f"{st}_" \
f"{bmt_type}_" \
f"{flood_type}"

# extend the BIM dictionary
BIM.update(dict(
FloodType = flood_type,
BasementType=bmt_type,
PostFIRM=PostFIRM,
))

return fl_config

31 changes: 20 additions & 11 deletions E7HurricaneWindWater/input_data/auto_pop/WindCECBRulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def CECB_config(BIM):
class.
"""

year = BIM['year_built'] # just for the sake of brevity
year = BIM['YearBuilt'] # just for the sake of brevity

# Roof cover
if BIM['roof_shape'] in ['gab', 'hip']:
if BIM['RoofShape'] in ['gab', 'hip']:
roof_cover = 'bur'
# Warning: HAZUS does not have N/A option for CECB, so here we use bur
else:
Expand All @@ -78,7 +78,7 @@ def CECB_config(BIM):

# shutters
if year >= 2000:
shutters = BIM['WBD']
shutters = BIM['WindBorneDebris']
# BOCA 1996 and earlier:
# Shutters were not required by code until the 2000 IBC. Before 2000, the
# percentage of commercial buildings that have shutters is assumed to be
Expand All @@ -89,42 +89,51 @@ def CECB_config(BIM):
# up their businesses before Hurricane Katrina. In addition, compliance
# rates based on the Homeowners Survey data hover between 43 and 50 percent.
else:
if BIM['WBD']:
if BIM['WindBorneDebris']:
shutters = random.random() < 0.46
else:
shutters = False

# Wind Debris (widd in HAZSU)
# HAZUS A: Res/Comm, B: Varies by direction, C: Residential, D: None
WIDD = 'C' # residential (default)
if BIM['occupancy_class'] in ['RES1', 'RES2', 'RES3A', 'RES3B', 'RES3C',
if BIM['OccupancyClass'] in ['RES1', 'RES2', 'RES3A', 'RES3B', 'RES3C',
'RES3D']:
WIDD = 'C' # residential
elif BIM['occupancy_class'] == 'AGR1':
elif BIM['OccupancyClass'] == 'AGR1':
WIDD = 'D' # None
else:
WIDD = 'A' # Res/Comm

# Window area ratio
if BIM['window_area'] < 0.33:
if BIM['WindowArea'] < 0.33:
WWR = 'low'
elif BIM['window_area'] < 0.5:
elif BIM['WindowArea'] < 0.5:
WWR = 'med'
else:
WWR = 'hig'

if BIM['stories'] <= 2:
if BIM['NumberOfStories'] <= 2:
bldg_tag = 'C.ECB.L'
elif BIM['stories'] <= 5:
elif BIM['NumberOfStories'] <= 5:
bldg_tag = 'C.ECB.M'
else:
bldg_tag = 'C.ECB.H'

# extend the BIM dictionary
BIM.update(dict(
RoofCover = roof_cover,
Shutters = shutters,
WindowAreaRatio = WWR,
WindDebrisClass = WIDD
))

bldg_config = f"{bldg_tag}." \
f"{roof_cover}." \
f"{int(shutters)}." \
f"{WIDD}." \
f"{WWR}." \
f"{int(BIM['terrain'])}"
f"{int(BIM['TerrainRoughness'])}"

return bldg_config

Loading

0 comments on commit 21c0035

Please sign in to comment.