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
3 changes: 3 additions & 0 deletions avaframe/ana4Stats/probAna.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def updateCfgRange(cfg, cfgProb, varName):
log.info('Reference value of %s: %s is added' % (varName, str(valVal)))
cfg['GENERAL'][varName] = cfg['GENERAL'][varName] + '&' + str(valVal)

# add a scenario Name to VISUALISATION
cfg['VISUALISATION']['scenario'] = varName

return cfg


Expand Down
2 changes: 2 additions & 0 deletions avaframe/com1DFA/com1DFACfg.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ createRangeTimeDiagram = False
# if TTdiagram=True - save data for thalweg-time diagram,
# if False for range-time diagram with radar field of view
TTdiagram = True
# scenario name - can be used for plotting
scenario =


[INPUT]
Expand Down
10 changes: 7 additions & 3 deletions avaframe/in3Utils/cfgHandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import numpy as np
import pathlib
import pandas as pd

# Local imports
from avaframe.in3Utils import cfgUtils
Expand Down Expand Up @@ -90,7 +91,7 @@ def addInfoToSimName(avalancheDir, csvString=''):
return(simDF[vars])


def filterSims(avalancheDir, parametersDict, specDir=''):
def filterSims(avalancheDir, parametersDict, specDir='', simDF=''):
""" Filter simulations using a list of parameters and a pandas dataFrame of simulation configurations
if ~ is used as a prefix for a parameter - it is filtered according to values that do NOT match the value
provided with the ~Parameter
Expand All @@ -103,15 +104,18 @@ def filterSims(avalancheDir, parametersDict, specDir=''):
dictionary with parameter and parameter values for filtering
specDir: str
path to a directory where simulation configuration files can be found - optional
simDF: pandas DataFrame
optional - if simDF already available

Returns
--------
simNameList: list
list of simNames that match filtering criteria
"""

# load dataFrame for all configurations
simDF = cfgUtils.createConfigurationInfo(avalancheDir, standardCfg='', writeCSV=False, specDir=specDir)
if isinstance(simDF, pd.DataFrame) is False:
# load dataFrame for all configurations
simDF = cfgUtils.createConfigurationInfo(avalancheDir, standardCfg='', writeCSV=False, specDir=specDir)

# filter simulations all conditions in the parametersDict have to be met
if parametersDict != '':
Expand Down
6 changes: 5 additions & 1 deletion avaframe/in3Utils/cfgUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,11 @@ def appendCgf2DF(simHash, simName, cfgObject, simDF):
cfgDict = convertConfigParserToDict(cfgObject)
simItemDFGeneral = pd.DataFrame(data=cfgDict['GENERAL'], index=indexItem)
simItemDFInput = pd.DataFrame(data=cfgDict['INPUT'], index=indexItem)
simItemDF = pd.concat([simItemDFGeneral, simItemDFInput], axis=1)
if 'VISUALISATION' in cfgDict:
simItemDFVisualisation = pd.DataFrame(data=cfgDict['VISUALISATION'], index=indexItem)
simItemDF = pd.concat([simItemDFGeneral, simItemDFInput, simItemDFVisualisation], axis=1)
else:
simItemDF = pd.concat([simItemDFGeneral, simItemDFInput], axis=1)
simItemDF = simItemDF.assign(simName=simName)
if isinstance(simDF, str):
simDF = simItemDF
Expand Down