Commit 4ca2d895 authored by Danijel Schorlemmer's avatar Danijel Schorlemmer
Browse files

Update Fragility_to_Dictionary.py

parent a9be6128
......@@ -16,17 +16,13 @@ import csv
# and the specific gm-type column-number in
# the ground-motion-field file.
def Fragility_to_Dictionary(gmDict,taxonomyConversionCsv,fragilities_path):
def Taxonomy_to_Fragility(gmDict, taxonomyToFragilitySource, fragilityFileDir):
taxonomyConversionDict = {}
for row in taxonomyConversionCsv:
fragilityFileName = row[1] + ".csv"
data = list(csv.reader(open(fragilities_path + "/" + fragilityFileName)))
gmType=data[0][0]
columnNumber = gmDict[gmType]
if row[0] in taxonomyConversionDict:
taxonomyToFragilityMap = {}
for mappingItem in taxonomyToFragilitySource:
data = list(csv.reader(open(fragilities_path + "/" + mappingItem[1] + ".csv")))
if mappingItem[0] in taxonomyToFragilityMap:
# implement your duplicate row handling here
pass
dictValue = [row[1],columnNumber]
taxonomyConversionDict[row[0]] = dictValue
return(taxonomyConversionDict,gmType)
taxonomyConversionDict[mappingItem[0]] = [mappingItem[1], gmDict[data[0][0]]]
return(taxonomyConversionDict)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment