Open glenncampagna opened 1 year ago
/media/model/p6/out/river/hsp2_2022/hydr
will show northern segments that have hsp2 model runs completed:
printf "%-13.13s\n" ???_????_????* | uniq
JA0_7291_7290
JA1_7600_7570
JA1_7640_7280
JA2_7290_0001
JA2_7410_7470
JA2_7550_7280
JA2_7570_7480
JA4_7280_7340
JA4_7340_7470
JA4_7470_7480
JA5_7480_0001
JB0_7051_0001
...
continuing through all the unique segments
render()
command https://github.com/HARPgroup/HARParchive/issues/825#issuecomment-1551645122commandArgs()
in the R.utils
packageWhen programming, the goal is to be robust, reproducible, and efficient.
Example:
if (exists("json_obj_url")) {
rseg_obj_url.r <- paste(json_obj_url, rseg.model.r$pid, sep="/")
rseg_model_info.r <- ds$auth_read(rseg_obj_url.r, "text/json", "")
rseg_model_info.r <- fromJSON(rseg_model_info.r)
} else {
message("Error: json_obj_url is undefined. Can not retrieve model and scenario information. (Hint: Use config.R
to set json_obj_url) ")
rseg_model_info.r <- list()
}
{r, echo=FALSE}
to hide code chunks that are not necessary to display{r, warning=FALSE}
to eliminate warning messages produced by a certain code chunk (e.g. a data re-formatting loop may produce excessive warnings that are not of concern to the user) {r, include=FALSE}
to not include any outputs from a chunk. (e.g. REST retrieval outputs a lot of messages which may be unwanted in the document){r, eval=FALSE}
to not run a chunk entirely during the knit (e.g. it is desired to test the formatting, but there are incomplete chunks that halt the render process)RU4_5640_6030
Megan ran this segment using this render command:
rmarkdown::render('C:/aa_HARP/aa_GitHub/HARParchive/HARP-2022-Summer/AutomatedScripts/ws_model_summary.Rmd',
output_file = 'C:/aa_HARP/RappahannockMarkdown',
params = list(doc_title = "Test HSP2 Model Summary",
rseg.file.path = c("/media/model/p6/out/river/hsp2_2022/hydr/RU4_5640_6030_hydrd_wy.csv", "/media/model/p6/out/river/subsheds/hydr/RU4_5640_6030_hydrd_wy.csv"),
rseg.hydrocode = c("RU4_5640_6030","vahydrosw_wshed_RU4_5640_6030"),
rseg.ftype = c("cbp60","vahydro"),
rseg.model.version = c("cbp-6.0","cbp-6.1"),
runid.list = c("hsp2_2022","subsheds"),
rseg.metric.list = c("Qout","l90_Qout","l30_Qout","l07_Qout","l01_Qout","consumptive_use_frac","wd_cumulative_mgd","ps_cumulative_mgd","wd_mgd","ps_mgd")
)
)
The output can be downloaded to view here.
Copied from #817
Megan and Glenn: