Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#135-hazus-damage-functions-linking-table #138

Merged
merged 4 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,6 @@ venv.bak/

/examples/data/miami_dade_landuse.gpkg
cache
/examples/FIAT_database
/examples/FIAT_database
hydromt_fiat/data/damage_functions/flooding/AllDDF_HAZUS_fractions.xlsx
hydromt_fiat/data/damage_functions/flooding/~$AllDDF_HAZUS_fractions.xlsx
3 changes: 0 additions & 3 deletions examples/data/hydromt_fiat_catalog_global.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

meta:
root: C:\Repositories\hydromt_fiat\hydromt_fiat\data

jrc_vulnerability_curves:
path: damage_functions/flooding/JRC_damage_functions.csv
data_type: DataFrame
Expand Down
39 changes: 0 additions & 39 deletions examples/data/vulnerability_test_file_input.csv

This file was deleted.

Binary file removed examples/data/vulnerability_test_file_input.xlsx
Binary file not shown.
16 changes: 10 additions & 6 deletions hydromt_fiat/data/hydromt_fiat_catalog_USA.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

meta:
root: C:\python\hydromt_fiat\hydromt_fiat\data

NSI:
path: "https://nsi.sec.usace.army.mil/nsiapi/structures?fmt=fc"
data_type: GeoDataFrame
Expand All @@ -11,12 +8,13 @@ NSI:
meta:
category: exposure

hazus_vulnerability_curves:
path: damage_functions/flooding/AllDDF_HAZUS.xlsx
default_vulnerability_curves:
path: damage_functions/flooding/Hazus_IWR_curves.csv
data_type: DataFrame
driver: xlsx
driver: csv
meta:
category: vulnerability
source: HAZUS SQL database, USACE-IWR and FEMA expert elicitation curves. The source of these curves is the Draft Report Nonresidential Flood Depth-Damage Functions Derived from Expert Elicitation, April 2009, Revised 2013. FEMA Contract Number HSFEHQ-06-D-0162. Task Order HSFEHQ-08-J-0014. Not for distribution, but data shared by USACE.

jrc_vulnerability_curves:
path: damage_functions/flooding/JRC_damage_functions.xlsx
Expand All @@ -39,3 +37,9 @@ social_vulnerability:
meta:
category: social_vulnerability

default_hazus_iwr_linking:
path: vulnerability_linking/default_hazus_iwr_curve_linking.csv
data_type: DataFrame
driver: csv
meta:
category: vulnerability
24 changes: 0 additions & 24 deletions hydromt_fiat/data/temp_database/config.ini

This file was deleted.

40 changes: 0 additions & 40 deletions hydromt_fiat/data/temp_database/data_catalog.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FIAT Damage Function Name,Exposure Link,Damage Type,ID,Occupancy,Description,Source
AGR1,AGR1,structure,616,AGR1,"Average Agriculture, structure",USACE - Galveston
COM1,COM1,structure,217,COM1,"Average Retail, Structure",USACE - Galveston
COM10,COM10,structure,543,COM10,"Garage, structure",USACE - Galveston
COM2,COM2,structure,341,COM2,"Average wholesale, Structure",USACE - Galveston
COM3,COM3,structure,32,COM3-S-MostLikely,Average Personal & Repair Services,USACE - IWR
COM4,COM4,structure,35,COM4-S-MostLikely,Average Prof/Tech Services,USACE - IWR
COM5,COM5,structure,467,COM5,"Bank, Structure",USACE - Galveston
COM6,COM6,structure,38,COM6-S-MostLikely,Hospital,USACE - IWR
COM7,COM7,structure,475,COM7,"Average Medical Office, Structure",USACE - Galveston
COM8,COM8,structure,493,COM8,"Average Entertainment/Recreation, Structure",USACE - Galveston
COM9,COM9,structure,532,COM9,"Average theatre, Structure",USACE - Galveston
EDU1,EDU1,structure,53,EDU1-S-MostLikely,Average school,USACE - IWR
EDU2,EDU2,structure,652,EDU2,"Average college/university, structure",USACE - Galveston
GOV1,GOV1,structure,631,GOV1,"Average government services, structure",USACE - Galveston
GOV2,GOV2,structure,640,GOV2,"Average emergency response, Structure",USACE - Galveston
IND1,IND1,structure,545,IND1,"Average heavy industrial, Structure",USACE - Galveston
IND2,IND2,structure,44,IND2-S-MostLikely,Average light industrial,USACE - IWR
IND3,IND3,structure,575,IND3,"Average Food/Drug/Chem, Structure",USACE - Galveston
IND4,IND4,structure,586,IND4,"Average Metals/Minerals processing, structure",USACE - Galveston
IND5,IND5,structure,591,IND5,"Average High Technology, structure",USACE - Galveston
IND6,IND6,structure,592,IND6,"Average Construction, structure",USACE - Galveston
REL1,REL1,structure,47,REL1-S-MostLikely,Church,USACE - IWR
RES1-1SNB,RES1-1SNB,structure,2,RES1-1SNB-S-MostLikely,"Res 1, 1 Story no Basement",USACE - IWR
RES1-1SWB,RES1-1SWB,structure,5,RES1-1SWB-S-MostLikely,"Res 1, 1 Story w/ Basement",USACE - IWR
RES1-2SNB,RES1-2SNB,structure,8,RES1-2SNB-S-MostLikely,"Res 1, 2 Story no Basement",USACE - IWR
RES1-2SWB,RES1-2SWB,structure,11,RES1-2SWB-S-MostLikely,"Res 1, 2 Story w/ Basement",USACE - IWR
RES1-3SNB,RES1-3SNB,structure,117,RES1,"three or more floors, no basement, Structure, V-Zone",FIA
RES1-3SWB,RES1-3SWB,structure,127,RES1,"three or more floors, w/ basement, Structure, V-Zone",FIA
RES2,RES2,structure,20,RES2-S-MostLikely,Mobile home,USACE - IWR
RES3A,RES3A,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3B,RES3B,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3C,RES3C,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3D,RES3D,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3E,RES3E,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3F,RES3F,structure,23,RES3-S-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES4,RES4,structure,26,RES4-S-MostLikely,"Average Hotel, & Motel",USACE - IWR
RES5,RES5,structure,50,RES5-PRO-SVC-S-MostLikely,Nursing Home,USACE - IWR
RES6,RES6,structure,215,RES6,"Nursing Home, structure",USACE - Galveston
AGR1,AGR1,content,460,AGR1 ,"Average Agriculture, Contents (Equipment/Inventory)",USACE - Galveston
COM1,COM1,content,90,COM1 ,Average retail trade contents (Inventory/Equipment),USACE - Galveston
COM10,COM10,content,357,COM10,"Garage, Contents (Inventory)",USACE - Galveston
COM2,COM2,content,195,COM2 ,"Average wholesale trade, Contents",USACE - Galveston
COM3,COM3,content,92,COM3-C-MostLikely,Average Personal & Repair Services,USACE - IWR
COM4,COM4,content,95,COM4-C-MostLikely,Average Prof/Tech Services,USACE - IWR
COM5,COM5,content,304,COM5 ,"Bank, Contents",USACE - Galveston
COM6,COM6,content,98,COM6-C-MostLikely,Hospital,USACE - IWR
COM7,COM7,content,312,COM7 ,"Average Medical Offic/Clinic, Contents (Equipment/Inventory)",USACE - Galveston
COM8,COM8,content,322,COM8 ,"Average Entertainment/Recreation, Contents (Equipment/Inventory)",USACE - Galveston
COM9,COM9,content,352,COM9 ,"Theater, Contents (Equipment)",USACE - Galveston
EDU1,EDU1,content,113,EDU1-C-MostLikely,Average school,USACE - IWR
EDU2,EDU2,content,485,EDU2 ,"Average College/University, Contents (Equipment/Inventory)",USACE - Galveston
GOV1,GOV1,content,472,GOV1 ,"Average Govt Services, contents (Equipment)",USACE - Galveston
GOV2,GOV2,content,477,GOV2 ,"Average emergency response, contents (Equipment/Inventory)",USACE - Galveston
IND1,IND1,content,358,IND1 ,"Average Heavy Industrial, Contents (Equipment/Inventory)",USACE - Galveston
IND2,IND2,content,104,IND2-C-MostLikely,Average light industrial,USACE - IWR
IND3,IND3,content,408,IND3 ,"Average Food/Drugs/Chemicals, Contents (Equipment/Inventory)",USACE - Galveston
IND4,IND4,content,433,IND4 ,"Average Metals/Minerals Processing, Contents (Equipment/Inventory)",USACE - Galveston
IND5,IND5,content,442,IND5 ,"Average High Technology, contents (Equipment/Inventory)",USACE - Galveston
IND6,IND6,content,443,IND6 ,"Average Construction, contents (Equipment/Inventory)",USACE - Galveston
REL1,REL1,content,107,REL1-C-MostLikely,Church,USACE - IWR
RES1-1SNB,RES1-1SNB,content,62,RES1-1SNB-C-MostLikely,"Res 1, 1 Story no Basement",USACE - IWR
RES1-1SWB,RES1-1SWB,content,65,RES1-1SWB-C-MostLikely,"Res 1, 1 Story w/ Basement",USACE - IWR
RES1-2SNB,RES1-2SNB,content,68,RES1-2SNB-C-MostLikely,"Res 1, 2 Story no Basement",USACE - IWR
RES1-2SWB,RES1-2SWB,content,71,RES1-2SWB-C-MostLikely,"Res 1, 2 Story w/ Basement",USACE - IWR
RES1-3SNB,RES1-3SNB,content,33,RES1 ,"three or more floors, no basement, Contents, V-Zone",FIA (MOD.)
RES1-3SWB,RES1-3SWB,content,34,RES1 ,"three or more floors, w/ basement, Contents, V-Zone",FIA (MOD.)
RES2,RES2,content,80,RES2-C-MostLikely,Mobile home,USACE - IWR
RES3A,RES3A,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3B,RES3B,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3C,RES3C,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3D,RES3D,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3E,RES3E,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES3F,RES3F,content,83,RES3-C-MostLikely,"Condominium, living area on multiple floors",USACE - IWR
RES4,RES4,content,86,RES4-C-MostLikely,"Average Hotel, & Motel",USACE - IWR
RES5,RES5,content,110,RES5-PRO-SVC-C-MostLikely,Nursing Home,USACE - IWR
RES6,RES6,content,89,RES6 ,"Nursing Home, contents (Equipment)",USACE - Galveston
2 changes: 1 addition & 1 deletion hydromt_fiat/workflows/exposure_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def link_exposure_vulnerability(
damage_types: Optional[List[str]] = ["Structure", "Content"],
):
linking_dict = dict(
zip(exposure_linking_table["Link"], exposure_linking_table["Name"])
zip(exposure_linking_table["Exposure Link"], exposure_linking_table["FIAT Damage Function Name"])
)

# Find the column to link the exposure data to the vulnerability data
Expand Down
4 changes: 2 additions & 2 deletions hydromt_fiat/workflows/vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ def get_vulnerability_functions_from_one_file(
if vulnerability_values.max() > 1:
vulnerability_values = vulnerability_values / 100

vf_names = df_identifiers_linking["Name"].values
vf_names = df_identifiers_linking["FIAT Damage Function Name"].values

self.add_multiple(vf_names, hazard_values, vulnerability_values)

@staticmethod
def get_identifier_names(
df: pd.DataFrame, to_remove: list = ["Name", "Link", "Damage Type"]
df: pd.DataFrame, to_remove: list = ["FIAT Damage Function Name", "Exposure Link", "Damage Type"]
) -> list:
"""_summary_

Expand Down
4 changes: 2 additions & 2 deletions tests/test_SVI_exposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_hazus_iwr_linking",
"functions_mean": "default",
"functions_max": ["AGR1"],
"unit": "feet",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_vulnerability_curves",
"functions_mean": "default",
"functions_max": ["AGR1"],
"unit": "feet",
Expand Down Expand Up @@ -85,8 +85,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_vulnerability_curves",
"functions_mean": "default",
"functions_max": ["AGR1"],
"unit": "feet",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_vulnerability_exposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_hazus_iwr_linking",
"functions_mean": "default",
"functions_max": ["AGR1"],
"unit": "feet",
Expand Down Expand Up @@ -73,8 +73,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_hazus_iwr_linking",
"functions_mean": "default",
"functions_max": ["AGR1"],
"unit": "feet",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_vulnerability_exposure_add_to_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"output_vector_name": "spatial.gpkg",
},
"setup_vulnerability": {
"vulnerability_fn": "hazus_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": ".\\examples\\data\\vulnerability_test_file_input_miami_landuse.csv",
"vulnerability_fn": "default_vulnerability_curves",
"vulnerability_identifiers_and_linking_fn": "default_hazus_iwr_linking",
"unit": "feet",
},
"setup_exposure_vector": {
Expand Down