Skip to content
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 avaframe/ana3AIMEC/aimecTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ def readAIMECinputs(avalancheDir, pathDict, defineRunoutArea, dirName='com1DFA')
# check for reference data
referenceDir= pathlib.Path(avalancheDir, 'Inputs')

# file names need to contain: _LINE, _POLY, _POINT
referenceTypes = {"referenceLine": "LINE", "referencePolygon": "POLY",'referencePoint': 'POINT'}
for refType in referenceTypes:
referenceFile, availableFile, _ = gI.getAndCheckInputFiles(
referenceDir,
"REFDATA",
referenceTypes[refType],
fileExt="shp",
fileSuffix=referenceTypes[refType],
fileSuffix=("_" + referenceTypes[refType]),
)
if availableFile == 'Yes':
# add file paths to pathDict
Expand Down Expand Up @@ -1643,6 +1644,7 @@ def createReferenceDF(pathDict):
newLine = newLine.set_index(hashRef)
referenceDF = pd.concat([referenceDF, newLine], ignore_index=False)
referenceDF.loc[hashRef, 'dataType'] = 'reference'
referenceDF.loc[hashRef, "reference_Type"] = refFile.stem.split("_")[1]

# TODO add here if additional info read from shp or a textfile?

Expand Down
9 changes: 6 additions & 3 deletions avaframe/ana3AIMEC/ana3AIMEC.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def mainAIMEC(pathDict, inputsDF, cfg):
if cfgSetup.getboolean('includeReference'):
referenceDF = aimecTools.createReferenceDF(pathDict)
refDataTransformed, referenceDF = postProcessReference(cfg, rasterTransfo, pathDict, referenceDF, newRasters)
# save resultsDF to file
referenceDFPath = pathlib.Path(pathDict["pathResult"], "referenceDF.csv")
referenceDF.to_csv(referenceDFPath)
else:
refDataTransformed = {}

Expand All @@ -178,7 +181,7 @@ def mainAIMEC(pathDict, inputsDF, cfg):
if sorted(pathDict['resTypeList']) == sorted(['ppr', 'pft', 'pfv']) and cfgPlots.getboolean('extraPlots'):
outAimec.visuSimple(cfgSetup, rasterTransfo, resAnalysisDF, newRasters, pathDict)
if len(resAnalysisDF.index) == 2 and sorted(pathDict['resTypeList']) == sorted(['ppr', 'pft', 'pfv']):
plotName = outAimec.visuRunoutComp(rasterTransfo, resAnalysisDF, cfgSetup, pathDict)
plotName = outAimec.visuRunoutComp(rasterTransfo, resAnalysisDF, cfgSetup, pathDict)

plotName = outAimec.visuRunoutStat(rasterTransfo, inputsDF, resAnalysisDF, newRasters, cfgSetup, pathDict)

Expand Down Expand Up @@ -415,9 +418,9 @@ def postProcessAIMEC(cfg, rasterTransfo, pathDict, resAnalysisDF, newRasters, ti


def postProcessReference(cfg, rasterTransfo, pathDict, referenceDF, newRasters):
""" Apply domain transformation and analyse reference data, e.g. compute runout point
"""Apply domain transformation and analyse reference data, e.g. compute runout point

Apply the domain tranformation to reference data sets
Apply the domain transformation to reference data sets
Analyse them.
Calculate runout

Expand Down
Loading