Skip to content

Commit

Permalink
Cleaning up: e.g., adding 'median' to the list of aggregation functio…
Browse files Browse the repository at this point in the history
…n to choose from
  • Loading branch information
dschlaep committed Sep 12, 2016
1 parent e438fd6 commit 916b8d1
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 153 deletions.
23 changes: 12 additions & 11 deletions 2_SWSF_p1of5_Settings_v51.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dir.out <- file.path(dir.big, "4_Data_SWOutputAggregated") #path to aggregated o
# - output handling
# - "concatenate": moves results from the simulation runs (temporary text files) to a SQL-database
actions <- c("create", "execute", "aggregate", "concatenate")
#continues with unfinished part of simulation after abort if TRUE, i.e.,
#continues with unfinished part of simulation after abort if TRUE, i.e.,
# - it doesn't delete an existing weather database, if a new one is requested
# - it doesn't re-extract external information (soils, elevation, climate normals, NCEPCFSR) if already extracted
# - it doesn't lookup values from tables if already available in input datafiles, i.e., 'LookupEvapCoeffFromTable', 'LookupTranspRegionsFromTable', and 'LookupSnowDensityFromTable'
Expand Down Expand Up @@ -145,7 +145,7 @@ dbW_compression_type <- "gzip" # one of eval(formals(memCompress)[[2]]); this on

#-Spatial setup of simulations
# Should the locations of 'SWRunInformation' interpreted as 2D-cells of a raster/grid or as 1D-sites
# sim_cells_or_points: currently, implemented for
# sim_cells_or_points: currently, implemented for
# - actions == "map_inputs"
# - external extractions:
# - soils: "ExtractSoilDataFromISRICWISEv12_Global", "ExtractSoilDataFromCONUSSOILFromSTATSGO_USA",
Expand Down Expand Up @@ -315,20 +315,21 @@ simulation_timescales <- c("daily", "monthly", "yearly")
# functions to aggregate output across years
# don't delete names, only set \code{TRUE}/\code{FALSE}
agg_funs <- list(
mean = TRUE,
SD = TRUE,
quantile = TRUE,
mad = TRUE,
yearly = TRUE
mean = TRUE,
SD = TRUE,
quantile = TRUE,
median = TRUE,
mad = TRUE,
yearly = TRUE
)
agg_fun_options <- list(
quantile = list(probs = c(0, 0.025, 0.5, 0.975, 1))
quantile = list(probs = c(0, 0.025, 0.5, 0.975, 1))
)
# named list of time windows to aggregate over
agg_years <- c(
current1 = list(startyr:endyr),
current2 = list((endyr - 10):(endyr + 10)),
future = apply(future_yrs, 1, function(x) x["DSfut_startyr"]:x["DSfut_endyr"])
current1 = list(startyr:endyr),
current2 = list((endyr - 10):(endyr + 10)),
future = apply(future_yrs, 1, function(x) x["DSfut_startyr"]:x["DSfut_endyr"])
)
#turn aggregation for variable groups on (1) or off (0), don't delete any variable group labels
output_aggregates <- c(
Expand Down
Loading

0 comments on commit 916b8d1

Please sign in to comment.