Skip to content
Merged
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
17 changes: 9 additions & 8 deletions avaframe/com8MoTPSA/com8MoTPSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def com8MoTPSAPostprocess(simDict, cfgMain, inputSimFiles):
for key in simDict:
workDir = pathlib.Path(avalancheDir) / "Work" / "com8MoTPSA" / str(key)

# identify simType
simType = simDict[key]["simType"]

# Copy DataTime.txt
dataTimeFile = workDir / "DataTime.txt"
shutil.copy2(dataTimeFile, outputDir / (str(key) + "_DataTime.txt"))
Expand All @@ -88,29 +91,29 @@ def com8MoTPSAPostprocess(simDict, cfgMain, inputSimFiles):
# Copy ppr files
pprFiles = list(workDir.glob("*p?_max*"))
targetFiles = [
pathlib.Path(str(f.name).replace("null_psa_p1_max", "null_dfa_ppr")) for f in pprFiles
pathlib.Path(str(f.name).replace("%s_psa_p1_max" % simType, "%s_dfa_ppr" % simType)) for f in pprFiles
]
targetFiles = [pathlib.Path(str(f).replace("null_psa_p2_max", "null_psa_ppr")) for f in targetFiles]
targetFiles = [pathlib.Path(str(f).replace("%s_psa_p2_max" % simType, "%s_psa_ppr" % simType)) for f in targetFiles]
targetFiles = [outputDirPeakFile / f for f in targetFiles]
for source, target in zip(pprFiles, targetFiles):
shutil.copy2(source, target)

# Copy pfd files
pfdFiles = list(workDir.glob("*h?_max*"))
targetFiles = [
pathlib.Path(str(f.name).replace("null_psa_h1_max", "null_dfa_pfd")) for f in pfdFiles
pathlib.Path(str(f.name).replace("%s_psa_h1_max" % simType, "%s_dfa_pfd" % simType)) for f in pfdFiles
]
targetFiles = [pathlib.Path(str(f).replace("null_psa_h2_max", "null_psa_pfd")) for f in targetFiles]
targetFiles = [pathlib.Path(str(f).replace("%s_psa_h2_max" % simType, "%s_psa_pfd" % simType)) for f in targetFiles]
targetFiles = [outputDirPeakFile / f for f in targetFiles]
for source, target in zip(pfdFiles, targetFiles):
shutil.copy2(source, target)

# Copy pfv files
pfvFiles = list(workDir.glob("*s?_max*"))
targetFiles = [
pathlib.Path(str(f.name).replace("null_psa_s1_max", "null_dfa_pfv")) for f in pfvFiles
pathlib.Path(str(f.name).replace("%s_psa_s1_max" % simType, "%s_dfa_pfv" % simType)) for f in pfvFiles
]
targetFiles = [pathlib.Path(str(f).replace("null_psa_s2_max", "null_psa_pfv")) for f in targetFiles]
targetFiles = [pathlib.Path(str(f).replace("%s_psa_s2_max" % simType, "%s_psa_pfv" % simType)) for f in targetFiles]
targetFiles = [outputDirPeakFile / f for f in targetFiles]
for source, target in zip(pfvFiles, targetFiles):
shutil.copy2(source, target)
Expand Down Expand Up @@ -234,5 +237,3 @@ def com8MoTPSAPreprocess(simDict, inputSimFiles, cfgMain):
cfgToRcf(cfg, rcfFileName)
rcfFiles.append(rcfFileName)
return rcfFiles


Loading