Skip to content
Snippets Groups Projects
Commit bf17fa48 authored by R0slyn's avatar R0slyn
Browse files

tweaks to create shock file script

parent 0796efca
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ createShockFile = function(scenario){
if (dir.exists(file.path(baseOutputDir,ensDir))) {
print(paste(ensDir, "exists. Creating shock file"))
write.csv(paramValues, file.path(baseOutputDir,ensDir,"shocks.csv"), row.names=FALSE, quote=FALSE)
write.csv(shockValues, file.path(baseOutputDir,ensDir,"shocksRecord.csv"), row.names=FALSE, quote=FALSE)
write.csv(shockValues, file.path(baseOutputDir,ensDir,paste0("shocksRecord_",scenario[,Scenario],".csv")), row.names=FALSE, quote=FALSE)
}
else{
print(paste(ensDir, "does not exist. Stopping"))
......@@ -112,7 +112,8 @@ drawValue <- function(shockType, paramName){
randomValue
}
baseDataDir = "/exports/csce/eddie/geos/groups/LURG/models/PLUM"
plumDirectory = "/exports/csce/eddie/geos/groups/LURG/models/PLUM"
baseDataDir = "/exports/csce/eddie/geos/groups/LURG/models/PLUM/plumv2/data"
baseOutputDir="/exports/csce/eddie/geos/groups/LURG/models/PLUM/output" # "~/Downloads"
shockDistFile = fread(file.path(baseDataDir, "shockDistributions.csv"))
......@@ -120,7 +121,7 @@ shockProbs = fread(file.path(baseDataDir,"shockProbabilities.csv"))
ensembleFile = commandArgs(trailingOnly = TRUE)[1]
scenarioTable = fread(file.path(baseDataDir,"sims",ensembleFile))
scenarioTable = fread(file.path(plumDirectory,ensembleFile))
for(i in 1:nrow(scenarioTable)){
#first if column exists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment