diff --git a/.Rbuildignore b/.Rbuildignore index 1acafc03ea55db9303760eda3c19b7b5f943457f..d871a8902470a6776eb20e3bf42aafaa24c01c62 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,3 +5,4 @@ ^\.gitlab-ci\.yml$ ^data-raw$ ^LICENSE\.md$ +^man-roxygen$ diff --git a/DESCRIPTION b/DESCRIPTION index b21bb1926aaad55daef70e5ffc19f6f828d4e0ee..bc9c6d2cb3c75c5defc4d0fd3ef02561192a9b7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,6 +40,7 @@ Imports: stats, utils, zoo +Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.2 Remotes: url::https://gitlab.irstea.fr/in-wop/airGRiwrm/-/archive/dev/airGRiwrm-dev.zip diff --git a/NAMESPACE b/NAMESPACE index 4364543ac5d718a1ec935493b491253178b75bff..7e640b9aa14cbe101df2d7bbf2425ec619fdb828 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,7 +27,6 @@ export(calcQMNA) export(calcQMNAn) export(calcVCN) export(calcVCNn) -export(climato_safran2bvi) export(createBasinsObs) export(getAprioriIds) export(getDataPath) @@ -42,7 +41,6 @@ export(loadHypsoData) export(readDrias2020) export(readQsim) export(saveFlowDB) -export(selectBasins) import(airGRiwrm) import(magrittr) import(stats) diff --git a/R/Calibration.R b/R/Calibration.R index f7f0a2f8eb29be67cb46bdb96cf3c7b26a0fecd6..9d42817badc86c97a7bc9f45a331dd2d05badb2e 100644 --- a/R/Calibration.R +++ b/R/Calibration.R @@ -1,27 +1,36 @@ #' Simplified Calibration for BasinsObs object #' -#' @param BasinsObs -#' @param InputsModel -#' @param Ind_Run -#' @param export -#' @param AprioriIds -#' @param path_data +#' @description +#' It calls automatically: #' -#' @return +#' - [CreateInputsModel.BasinsObs] +#' - [airGRiwrm::CreateRunOptions] +#' - [airGRiwrm::CreateInputsCrit] +#' - [airGRiwrm::CreateCalibOptions] +#' - [airGRiwrm::Calibration] +#' +#' It calculates performance indicator on the model and save parameters and performance indicators into the file (`paramFile`). +#' +#' @inheritParams RunModel.BasinsObs +#' @param FUN_CRIT See [airGRiwrm::CreateInputsCrit] +#' @param AprioriIds See [airGRiwrm::CreateInputsCrit] +#' @param transfo See [airGR::CreateInputsCrit] +#' +#' @return a `GRiwrmOutputsCalib` object which is a [list] of `OutputsCalib` objects with one item per modelled sub-catchment. See [airGRiwrm::Calibration] #' @export #' @import airGRiwrm #' @import utils #' -#' @examples Calibration.BasinsObs <- function(BasinsObs, - ParamFile, + paramFile, InputsModel = CreateInputsModel(BasinsObs), IndPeriod_WarmUp = seq(1, 365), IndPeriod_Run = seq(366, length(BasinsObs$DatesR)), FUN_CRIT = airGR::ErrorCrit_KGE2, AprioriIds = getAprioriIds(InputsModel), transfo = "sqrt", - cfg = loadConfig()) { + cfg = loadConfig(), + ...) { RO <- CreateRunOptions( InputsModel, @@ -77,7 +86,7 @@ Calibration.BasinsObs <- function(BasinsObs, colnames(parametres) <- c("Id", "c", "X1", "X2", "X3", "X4", "Crit_Final", "KGE") if (cfg$data$write_results) { write.csv(x = parametres, - file = file.path(cfg$calibration$path, ParamFile), + file = file.path(cfg$calibration$path, paramFile), row.names = FALSE) } } diff --git a/R/CreateInputsModel.R b/R/CreateInputsModel.R index eb82271bd6902e4db7a0e8694ad464bde73f66eb..4cec8bdbd5646b3455c5e647d95f03fc1d93d644 100644 --- a/R/CreateInputsModel.R +++ b/R/CreateInputsModel.R @@ -1,12 +1,11 @@ -#' Title +#' Create Inputs for *airGRiwrm* model with `BasinsObs` object #' -#' @param BasinsObs +#' @inheritParams RunModel.BasinsObs #' -#' @return +#' @return See return value of [airGRiwrm::CreateInputsModel] #' @export #' -#' @examples -CreateInputsModel.BasinsObs <- function(BasinsObs) { +CreateInputsModel.BasinsObs <- function(BasinsObs, ...) { # Remove Q for hydrological modeled nodes Q <- NULL diff --git a/R/RunModel.R b/R/RunModel.R index 09a4cbdcfb7f76b5d860c7c41a3f791c52e05939..02f666c8910c63afa8269f069037d11e422ce35d 100644 --- a/R/RunModel.R +++ b/R/RunModel.R @@ -1,15 +1,16 @@ #' RunModel function for *BasinsObs* object #' -#' This function simplifies the run of an airGRiwrm model by chaining all the steps ([airGRiwrm::CreateInputsModel.GRiwrm], [airGRiwrm::CreateRunOptions.GRiwrmInputsModel] and [airGriwrm::RunModel.GRiwrmInputsModel]) into one single step. +#' This function simplifies the run of an airGRiwrm model by chaining all the steps ([airGRiwrm::CreateInputsModel.GRiwrm], [airGRiwrm::CreateRunOptions.GRiwrmInputsModel] and [airGRiwrm::RunModel.GRiwrmInputsModel]) into one single step. #' #' @param BasinsObs an object of class *BasinsObs*, see [loadBasinsObs] and [createBasinsObs] #' @param paramFile [character] the path of the file containing the model parameters (use to call [loadCalibrationParams]) #' @param InputsModel an object of class *GRiwrmInputsModel*, see [CreateInputsModel.BasinsObs] #' @param IndPeriod_WarmUp (optional) [numeric] index of period to be used for the model warm-up [-]. See [airGR::CreateRunOptions] for details #' @param IndPeriod_Run (optional) [numeric] index of period to be used for the model run [-]. See [airGR::CreateRunOptions] for details +#' @param ... not used (compatibility with others S3 methods) #' @template param_cfg #' -#' @return An object of class *GriwrmOutputsModel* produced by [airGriwrm::RunModel.GRiwrmInputsModel] +#' @return An object of class *GriwrmOutputsModel* produced by [airGRiwrm::RunModel.GRiwrmInputsModel] #' @export #' RunModel.BasinsObs <- function(BasinsObs, @@ -17,7 +18,8 @@ RunModel.BasinsObs <- function(BasinsObs, InputsModel = suppressMessages(CreateInputsModel(BasinsObs)), IndPeriod_WarmUp = seq(1, 365), IndPeriod_Run = seq(366, length(BasinsObs$DatesR)), - cfg = loadConfig()) { + cfg = loadConfig(), + ...) { RunOptions <- suppressWarnings( airGRiwrm::CreateRunOptions( diff --git a/R/addReservoirsGRiwrm.R b/R/addReservoirsGRiwrm.R index 5b5174f2cb8ccb70feea9de971f2cc3e83e85229..b6bb9b989533dd46f555aa2770b322297d02c4b5 100644 --- a/R/addReservoirsGRiwrm.R +++ b/R/addReservoirsGRiwrm.R @@ -1,11 +1,10 @@ -#' Title +#' Add Seine lakes-reservoirs to the `GRiwrm` object #' -#' @param griwrm +#' @param griwrm Network description (See [CreateGRiwrm]) #' -#' @return +#' @return `GRiwrm` object with connections of the reservoirs to the Seine network #' @export #' -#' @examples addReservoirsGRiwrm <- function(griwrm) { dfConnect <- data.frame( diff --git a/R/addReservoirsQ.R b/R/addReservoirsQ.R index fa6f52a484cb228f8dda7226c591ff8649a7277f..3321b53cd487e76304933ea03c4943776c72a6e5 100644 --- a/R/addReservoirsQ.R +++ b/R/addReservoirsQ.R @@ -1,12 +1,10 @@ -#' Title +#' Add recorded flows on Seine Grands Lacs reservoir connections to a `BasinsObs` database #' -#' @param BasinsObs -#' @param path_data +#' @inheritParams RunModel.BasinsObs #' -#' @return +#' @return a `BasinsObs` object completed with recorded flows at reservoir connections #' @export #' -#' @examples addReservoirsQ <- function(BasinsObs, cfg = loadConfig()) { P <- BasinsObs$P E <- BasinsObs$E diff --git a/R/calcQJXA.R b/R/calcQJXA.R index ff9e855cf455538188807ba1b293e4bd15c2f28e..b05b5ec73f2492065811c59bf09ec3725911f623 100644 --- a/R/calcQJXA.R +++ b/R/calcQJXA.R @@ -4,7 +4,7 @@ #' #' @param x [POSIXt] dates, or [data.frame] with a first column with dates, or \code{OutputsModel} produced by [airGR::RunModel] #' @param flows [numeric] flows in l/s for use with x as a [POSIXt] -#' @param pRet [numeric] return period in years +#' @param ... for S3 method compability #' #' @return A [vector] of [numeric] for x [POSIXt] or \code{OutputsModel} and a [data.frame] for x [data.frame] #' @@ -61,7 +61,7 @@ calcQJXA <- function(x, ...) { #' @export #' @rdname calcQJXA -calcQJXA.data.frame <- function(x) { +calcQJXA.data.frame <- function(x, ...) { if(ncol(x)<2) stop("x should have at least 2 columns") apply(x[,-1, drop=F], 2, function(y) { calcQJXA(x[,1], y) @@ -72,7 +72,7 @@ calcQJXA.data.frame <- function(x) { #' @rdname calcQJXA #' @export calcQJXA.OutputsModel <- - function(x) { + function(x, ...) { calcQJXA( x = x$DatesR, flows = x$Qsim @@ -83,7 +83,7 @@ calcQJXA.OutputsModel <- #' @rdname calcQJXA #' @export calcQJXA.POSIXt <- - function(x, flows) { + function(x, flows, ...) { dates <- x ##_____Arguments_check________________________________________________________ diff --git a/R/calcQMNA.R b/R/calcQMNA.R index 46efeafc48836588bdc31bef004fa6ff46f2c929..445d362718f164b1fd7af68a13d2af8181b96d56 100644 --- a/R/calcQMNA.R +++ b/R/calcQMNA.R @@ -152,12 +152,11 @@ calcQMNA.POSIXt <- function(x, flows) { #' @export #' #' @examples -#' # First calculation of QMNAs (Minimum monthly flow for each year) -#' example("calcQMNA") +#' #! load data +#' data(L0123001, package = "airGR") #' -#' # Second calculation of QMNA for a given return period -#' calcQMNAn(QMNA_Obs, 5) -#' calcQMNAn(QMNA_GR4J, 5) +#' dfQ <- data.frame(DatesR = BasinObs$DatesR, Q = BasinObs$Qls / 1000) +#' calcQMNAn(dfQ, 5) #' calcQMNAn <- function(x, return_period) { UseMethod("calcQMNAn", x) diff --git a/R/calcVCN.R b/R/calcVCN.R index de0124d60169fbace9a6a7c01abff17411b27f62..bd6854cdf2699222a82f2bd3dc83e3da4805f720 100644 --- a/R/calcVCN.R +++ b/R/calcVCN.R @@ -41,12 +41,12 @@ calcVCN.numeric <- function(x, k, ...) { #' @export #' #' @examples -#' # First calculation of QMNAs (Minimum monthly flow for each year) -#' example("calcQMNA") +#' #! load data +#' data(L0123001, package = "airGR") +#' dfQ <- data.frame(DatesR = BasinObs$DatesR, Q = BasinObs$Qls / 1000) #' -#' # Second calculation of QMNA for a given return period -#' calcQMNAn(QMNA_Obs, 5) -#' calcQMNAn(QMNA_GR4J, 5) +#' # VCN10 return period of 2 years +#' calcVCNn(dfQ, 10, 5) #' calcVCNn <- function(x, k, return_period, ...) { UseMethod("calcVCNn", x) diff --git a/R/climato_safran2bvi.R b/R/climato_safran2bvi.R index 2bc7aed3950a064795ea72a26aafbbdb2a8e8f9a..b730e3bb4ddfb8532ccc0580170e8fb344215eb4 100644 --- a/R/climato_safran2bvi.R +++ b/R/climato_safran2bvi.R @@ -1,13 +1,10 @@ -#' Title +#' Convert a data from a SAFRAn grid to BVI scale #' -#' @param safran -#' @param dfMailles -#' @param cfg +#' @param safran data in SAFRAn format +#' @param dfMailles correspondence between SAFRAN grid and BVIs #' -#' @return -#' @export +#' @return [matrix] #' -#' @examples climato_safran2bvi <- function(safran, dfMailles) { dfMailles$id_safran <- paste(dfMailles$x, dfMailles$y, sep = "x") bvi_ids <- unique(dfMailles$CODE) diff --git a/R/createBasinsObs.R b/R/createBasinsObs.R index 6d1881d4e8cc49ea6dda10bcd38bbf0f04e0240d..46690eba4bf1765b4c86784b54cc7762d43dd94b 100644 --- a/R/createBasinsObs.R +++ b/R/createBasinsObs.R @@ -1,4 +1,4 @@ -#' Create an object `BasinsObs` +#' Create an object `BasinsObs` from SAFRAN grid #' #' @param files [character] containing list of NetCFD DRIAS2020 files to read for precipitation and evaporation and for both historical and RCP periods for a given climatic scenario #' @param dfMailles [data.frame] with correspondence between SAFRAN cells and intermediate basins @@ -13,7 +13,6 @@ #' @export #' @import magrittr #' -#' @examples createBasinsObs <- function(files, dfMailles, cfg = loadConfig()) { # Precipitations diff --git a/R/data.R b/R/data.R index fd8ad53c325fa6f7dbef4eab2cb0d285461f95bb..630c76ef709ecec1c01f3f173d8c82e5c5d4646d 100644 --- a/R/data.R +++ b/R/data.R @@ -13,6 +13,6 @@ #' Description of the semi-distributed network of the Seine basin gauging stations #' -#' @format A GRiwrm object created by [airGRiwrm:CreateGRiwrm] +#' @format A GRiwrm object created by [airGRiwrm::CreateGRiwrm] #' @references Laura Nunez Torres. Simulation d'un bassin versant anthropisé à l'aide d'un modèle hydrologique semi-distribué : Le bassin de la Seine et ses réservoirs Rapport de stage ST5 -Polytech Sorbonne -1er septembre 2021. Milieux et Changements globaux. 2021. ⟨https://hal.inrae.fr/hal-033596177⟩ "griwrm" diff --git a/R/getAprioriIds.R b/R/getAprioriIds.R index f194f532acb9bd6d9a6d31e379a93c7f2973bd9e..ea9d0ae1aaf7e5549c4d2aec52000e7d8ab983e9 100644 --- a/R/getAprioriIds.R +++ b/R/getAprioriIds.R @@ -1,11 +1,14 @@ -#' Title +#' Selection of upstream gauging stations as a priori for Lavenne regularisation #' -#' @param InputsModel +#' @description +#' This function selects, for each gauging station, which direct upstream gauging station bring the maximum mean flow. +#' The calibration parameters of this station will be used as "a priori" parameter for the current gauging station (See [airGR::CreateInputsCrit_Lavenne]) #' -#' @return +#' @inheritParams RunModel.BasinsObs +#' +#' @return [character] named [vector] with each item defined as follow: station ID as key and upstream a priori station ID as value. #' @export #' -#' @examples getAprioriIds <- function(InputsModel) { unlist(sapply(InputsModel, FUN = function(x) { if (!is.null(x$Qupstream)){ diff --git a/R/getDataPath.R b/R/getDataPath.R index caba7168c0dbcca272dfea048e06f390cda2a8f1..1106838665c25e55cf22e3e716955201d165e689 100644 --- a/R/getDataPath.R +++ b/R/getDataPath.R @@ -1,21 +1,15 @@ #' Give the complete path of the data #' +#' @description #' If the database is a URL, this function can download the file in a temporary folder and returns the path of the downloaded file. This functionality is useful for [readxl::read_excel] (See: https://stackoverflow.com/a/41368947/5300212). #' #' @param path [character] representing the path of the data in the database -#' @param download download a URL in a temporary file? (Default `FALSE`) +#' @param download download a URL in a temporary file? (Default `TRUE`) #' @template param_cfg #' #' @return [character] with the path of the file to read #' @export #' -#' @examples -#' com_france <- readxl::read_excel( -#' getDataPath("usages/territoire/table-appartenance-geo-communes-16.xls", download = TRUE), -#' sheet = "COM", -#' skip = 5 -#' ) -#' str(com_france) getDataPath <- function(path, ..., download = TRUE, cfg = loadConfig(), root = cfg$data$path) { path <- file.path(path, ...) diff --git a/R/getDrias2020filenames.R b/R/getDrias2020filenames.R index c33b98b39e4c54b78a00b3ccce786e222484d7cc..319decc4135bf7d9f67efb264011f809c9ffbc4b 100644 --- a/R/getDrias2020filenames.R +++ b/R/getDrias2020filenames.R @@ -7,6 +7,7 @@ #' @export #' #' @examples +#' cfg <- loadConfig() #' driasFiles <- listDataFiles(file.path(cfg$hydroclim$path, "drias")) #' getDrias2020filenames("HadGEM2-ES/CCLM4-8-17", driasFiles) #' diff --git a/R/listDataFiles.R b/R/listDataFiles.R index cfee71c8d26b59f5fce483d22d0f46b12242eb37..d040f51ce931e68aa59d23637a97bd63d20f6f56 100644 --- a/R/listDataFiles.R +++ b/R/listDataFiles.R @@ -3,13 +3,15 @@ #' #' @param path a character vector of full path names; the default corresponds to the working #' directory, getwd(). -#' @param cfg +#' @template param_cfg #' @param ... Further parameters pass to [base::list.files] #' -#' @return +#' @return [character] [vector] with the file names #' @export #' #' @examples +#' cfg <- loadConfig() +#' listDataFiles(cfg$hydroclim$path) listDataFiles <- function(path, cfg = loadConfig(), ...) { if (cfg$data$cloud) { readLines(getDataPath(path, "list.files.txt")) diff --git a/R/loadBasinsObs.R b/R/loadBasinsObs.R index 19c815530935bd7108898216e980e97b0c4e89b0..4fc1ceb20eb04abe4fc7cfaefa607d7f33281aae 100644 --- a/R/loadBasinsObs.R +++ b/R/loadBasinsObs.R @@ -4,10 +4,13 @@ #' @param griwrm GRiwrm object describing the semi-distributed network (default `data("griwrm")`, see [griwrm]) #' @template param_cfg #' -#' @return +#' @return A `BasinsObs` object (See [createBasinsObs]) #' @export #' #' @examples +#' BasinsObs <- loadBasinsObs("BasinsObs_observations_day_1958-2019.RDS") +#' str(BasinsObs) +#' loadBasinsObs <- function(RDataFile, griwrm = NULL, cfg = loadConfig()) { file <- getDataPath(cfg$hydroclim$path, RDataFile, cfg = cfg) diff --git a/R/loadCalibrationParams.R b/R/loadCalibrationParams.R index 111be946d1e1cb300434099fda09575ebc51db9b..fb7d61b4db2c3afa66eef46a55b6ff3caa9a4b53 100644 --- a/R/loadCalibrationParams.R +++ b/R/loadCalibrationParams.R @@ -1,12 +1,14 @@ -#' Title +#' Load model calibration parameter #' -#' @param fileName -#' @param cfg +#' @details +#' This function is essentially called by [RunModel.BasinsObs]. #' -#' @return +#' @param fileName name of the file containing the calibration parameters (See [Calibration.BasinsObs]) +#' @template param_cfg +#' +#' @return [list] with one item by gauging station containing a [numeric] [vector] of parameters #' @export #' -#' @examples loadCalibrationParams <- function(fileName, cfg = loadConfig()) { file <- getDataPath(cfg$calibration$path, fileName) df <- read.csv(file) diff --git a/R/loadHydratecDB.R b/R/loadHydratecDB.R index 7d0b0b535597c82131132c74be0d1f22ee3809a5..a147bdd310fce70409bf0a301b380bfbc1ffab21 100644 --- a/R/loadHydratecDB.R +++ b/R/loadHydratecDB.R @@ -9,7 +9,6 @@ #' - `Q`: the times series of daily flows #' @export #' -#' @examples loadHydratecDB <- function(cfg = loadConfig()) { # Load time series file <- getDataPath(cfg$hydroclim$path, "EPTB_SGL/Qnat/Hydratec/Q_NAT_1900-2009.txt", cfg = cfg) diff --git a/R/loadHypsoData.R b/R/loadHypsoData.R index 1254b650cc98f853ec0826789228ca6461431972..bcd8e7e167fb5c31745074c93ca5da188b624c60 100644 --- a/R/loadHypsoData.R +++ b/R/loadHypsoData.R @@ -1,11 +1,14 @@ -#' Title +#' Load hypsometric data for Cemaneige snow module #' -#' @param data_path +#' @description +#' Read all the files contained in the folder `cfg$hydroclim$path`/courbes_hypsometriques +#' and merge them into a matrix #' -#' @return +#' @template param_cfg +#' +#' @return [matrix] with one column by gauging station #' @export #' -#' @examples loadHypsoData <- function(cfg = loadConfig()) { path_hypso <- file.path(cfg$hydroclim$path, "courbes_hypsometriques") hypso <- listDataFiles(path_hypso) diff --git a/R/readDrias2020.R b/R/readDrias2020.R index 7a6c83f1e7be0e07b9bc5a1a3fec3807ce67ce0f..9d9d07aca0b27c619c0f52a0767918d245d1764c 100644 --- a/R/readDrias2020.R +++ b/R/readDrias2020.R @@ -4,7 +4,7 @@ #' `files` could be a vector with the "Historical" and the "rcpn.n" files, the two times series are then merged into a continuous one. #' #' @param files [character] One or more file names to read without the path -#' @param cfg +#' @template param_cfg #' @param path the path of the files #' #' @return A [list] containing items: diff --git a/R/saveFlowDB.R b/R/saveFlowDB.R index 7fbd0d7c2da8384d9425583747bb5bf1bc85a1e7..3514cea7e385128d8223d1f4025719aab72c6588 100644 --- a/R/saveFlowDB.R +++ b/R/saveFlowDB.R @@ -1,14 +1,13 @@ #' Save database of one simulation #' #' @param path [character] the location used to save the database -#' @param InputsModel [GRiwrmInputsModel] see [CreateInputsModel.BasinsObs] -#' @param OutputsModel [GriwrmOutputsModel] see [RunModel.BasinsObs] +#' @param InputsModel `GRiwrmInputsModel` object. See [CreateInputsModel.BasinsObs] +#' @param OutputsModel `GriwrmOutputsModel` object. See [RunModel.BasinsObs] #' @template param_cfg #' -#' @return +#' @return `TRUE` if the last copy successed #' @export #' -#' @examples saveFlowDB <- function(path, InputsModel, OutputsModel, cfg = loadConfig()) { if (cfg$data$write_results) { diff --git a/R/selectBasins.R b/R/selectBasins.R index 1fea80f49ff22a1daa111d745489b764610e6d28..9cf09296d148b68e2c48fbca7ab999874678bfba 100644 --- a/R/selectBasins.R +++ b/R/selectBasins.R @@ -1,12 +1,3 @@ -#' Title -#' -#' @param BasinsObs -#' @param ids -#' -#' @return -#' @export -#' -#' @examples selectBasins <- function(BasinsObs, ids) { items <- names(BasinsObs) names(items) <- items diff --git a/man-roxygen/param_cfg.R b/man-roxygen/param_cfg.R index ec1c60ed81738ced761cd59a94f3ca0f6f92509b..e13b7e7dc8c4627bad77e4b2d5fa40bf0ee22490 100644 --- a/man-roxygen/param_cfg.R +++ b/man-roxygen/param_cfg.R @@ -1 +1 @@ -#' @param cfg a [config] object. Configuration to use. See [LoadConfig] for details +#' @param cfg a config object. Configuration to use. See [loadConfig] for details diff --git a/man/Calibration.BasinsObs.Rd b/man/Calibration.BasinsObs.Rd index 9b672828a324749ac3850eb2e3b24b7d674556aa..4be7a35eda54413a12a1a2222a6c6695258782b3 100644 --- a/man/Calibration.BasinsObs.Rd +++ b/man/Calibration.BasinsObs.Rd @@ -6,22 +6,50 @@ \usage{ \method{Calibration}{BasinsObs}( BasinsObs, - ParamFile, + paramFile, InputsModel = CreateInputsModel(BasinsObs), IndPeriod_WarmUp = seq(1, 365), IndPeriod_Run = seq(366, length(BasinsObs$DatesR)), FUN_CRIT = airGR::ErrorCrit_KGE2, AprioriIds = getAprioriIds(InputsModel), transfo = "sqrt", - cfg = loadConfig() + cfg = loadConfig(), + ... ) } \arguments{ -\item{path_data}{} +\item{BasinsObs}{an object of class \emph{BasinsObs}, see \link{loadBasinsObs} and \link{createBasinsObs}} + +\item{paramFile}{\link{character} the path of the file containing the model parameters (use to call \link{loadCalibrationParams})} + +\item{InputsModel}{an object of class \emph{GRiwrmInputsModel}, see \link{CreateInputsModel.BasinsObs}} + +\item{IndPeriod_WarmUp}{(optional) \link{numeric} index of period to be used for the model warm-up \link{-}. See \link[airGR:CreateRunOptions]{airGR::CreateRunOptions} for details} + +\item{IndPeriod_Run}{(optional) \link{numeric} index of period to be used for the model run \link{-}. See \link[airGR:CreateRunOptions]{airGR::CreateRunOptions} for details} + +\item{FUN_CRIT}{See \link[airGRiwrm:CreateInputsCrit]{airGRiwrm::CreateInputsCrit}} + +\item{AprioriIds}{See \link[airGRiwrm:CreateInputsCrit]{airGRiwrm::CreateInputsCrit}} + +\item{transfo}{See \link[airGR:CreateInputsCrit]{airGR::CreateInputsCrit}} + +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} + +\item{...}{not used (compatibility with others S3 methods)} } \value{ - +a \code{GRiwrmOutputsCalib} object which is a \link{list} of \code{OutputsCalib} objects with one item per modelled sub-catchment. See \link[airGRiwrm:Calibration]{airGRiwrm::Calibration} } \description{ -Simplified Calibration for BasinsObs object +It calls automatically: +\itemize{ +\item \link{CreateInputsModel.BasinsObs} +\item \link[airGRiwrm:CreateRunOptions]{airGRiwrm::CreateRunOptions} +\item \link[airGRiwrm:CreateInputsCrit]{airGRiwrm::CreateInputsCrit} +\item \link[airGRiwrm:CreateCalibOptions]{airGRiwrm::CreateCalibOptions} +\item \link[airGRiwrm:Calibration]{airGRiwrm::Calibration} +} + +It calculates performance indicator on the model and save parameters and performance indicators into the file (\code{paramFile}). } diff --git a/man/CreateInputsModel.BasinsObs.Rd b/man/CreateInputsModel.BasinsObs.Rd index 27f8c1cc2c8c82763249d2e66fea00ed1c2a061c..affff6f338b3fb82a6f6c56b18e260c39b569a98 100644 --- a/man/CreateInputsModel.BasinsObs.Rd +++ b/man/CreateInputsModel.BasinsObs.Rd @@ -2,16 +2,18 @@ % Please edit documentation in R/CreateInputsModel.R \name{CreateInputsModel.BasinsObs} \alias{CreateInputsModel.BasinsObs} -\title{Title} +\title{Create Inputs for \emph{airGRiwrm} model with \code{BasinsObs} object} \usage{ -\method{CreateInputsModel}{BasinsObs}(BasinsObs) +\method{CreateInputsModel}{BasinsObs}(BasinsObs, ...) } \arguments{ -\item{BasinsObs}{} +\item{BasinsObs}{an object of class \emph{BasinsObs}, see \link{loadBasinsObs} and \link{createBasinsObs}} + +\item{...}{not used (compatibility with others S3 methods)} } \value{ - +See return value of \link[airGRiwrm:CreateInputsModel]{airGRiwrm::CreateInputsModel} } \description{ -Title +Create Inputs for \emph{airGRiwrm} model with \code{BasinsObs} object } diff --git a/man/RunModel.BasinsObs.Rd b/man/RunModel.BasinsObs.Rd index ff31793211cd6e6d82dd4f376be372648ba6b5e9..386e7fe225ca6a9029f0598810e3fc23b42a432e 100644 --- a/man/RunModel.BasinsObs.Rd +++ b/man/RunModel.BasinsObs.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/RunModel.R \name{RunModel.BasinsObs} \alias{RunModel.BasinsObs} -\title{RunModel function for *BasinsObs* object} +\title{RunModel function for \emph{BasinsObs} object} \usage{ \method{RunModel}{BasinsObs}( BasinsObs, @@ -10,25 +10,28 @@ InputsModel = suppressMessages(CreateInputsModel(BasinsObs)), IndPeriod_WarmUp = seq(1, 365), IndPeriod_Run = seq(366, length(BasinsObs$DatesR)), - cfg = loadConfig() + cfg = loadConfig(), + ... ) } \arguments{ -\item{BasinsObs}{an object of class *BasinsObs*, see [loadBasinsObs] and [createBasinsObs]} +\item{BasinsObs}{an object of class \emph{BasinsObs}, see \link{loadBasinsObs} and \link{createBasinsObs}} -\item{paramFile}{[character] the path of the file containing the model parameters (use to call [loadCalibrationParams])} +\item{paramFile}{\link{character} the path of the file containing the model parameters (use to call \link{loadCalibrationParams})} -\item{InputsModel}{an object of class *GRiwrmInputsModel*, see [CreateInputsModel.BasinsObs]} +\item{InputsModel}{an object of class \emph{GRiwrmInputsModel}, see \link{CreateInputsModel.BasinsObs}} -\item{IndPeriod_WarmUp}{(optional) [numeric] index of period to be used for the model warm-up [-]. See [airGR::CreateRunOptions] for details} +\item{IndPeriod_WarmUp}{(optional) \link{numeric} index of period to be used for the model warm-up \link{-}. See \link[airGR:CreateRunOptions]{airGR::CreateRunOptions} for details} -\item{IndPeriod_Run}{(optional) [numeric] index of period to be used for the model run [-]. See [airGR::CreateRunOptions] for details} +\item{IndPeriod_Run}{(optional) \link{numeric} index of period to be used for the model run \link{-}. See \link[airGR:CreateRunOptions]{airGR::CreateRunOptions} for details} -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} + +\item{...}{not used (compatibility with others S3 methods)} } \value{ -An object of class *GriwrmOutputsModel* produced by [airGriwrm::RunModel.GRiwrmInputsModel] +An object of class \emph{GriwrmOutputsModel} produced by \link[airGRiwrm:RunModel.GRiwrmInputsModel]{airGRiwrm::RunModel.GRiwrmInputsModel} } \description{ -This function simplifies the run of an airGRiwrm model by chaining all the steps ([airGRiwrm::CreateInputsModel.GRiwrm], [airGRiwrm::CreateRunOptions.GRiwrmInputsModel] and [airGriwrm::RunModel.GRiwrmInputsModel]) into one single step. +This function simplifies the run of an airGRiwrm model by chaining all the steps (\link[airGRiwrm:CreateInputsModel.GRiwrm]{airGRiwrm::CreateInputsModel.GRiwrm}, \link[airGRiwrm:CreateRunOptions]{airGRiwrm::CreateRunOptions.GRiwrmInputsModel} and \link[airGRiwrm:RunModel.GRiwrmInputsModel]{airGRiwrm::RunModel.GRiwrmInputsModel}) into one single step. } diff --git a/man/addReservoirsGRiwrm.Rd b/man/addReservoirsGRiwrm.Rd index 0aa06b9bedfa75491591770c4b9b8745f6f133bb..2a45193f64ebd8b4ed2fbb7597e06ebf70c2c29b 100644 --- a/man/addReservoirsGRiwrm.Rd +++ b/man/addReservoirsGRiwrm.Rd @@ -2,16 +2,16 @@ % Please edit documentation in R/addReservoirsGRiwrm.R \name{addReservoirsGRiwrm} \alias{addReservoirsGRiwrm} -\title{Title} +\title{Add Seine lakes-reservoirs to the \code{GRiwrm} object} \usage{ addReservoirsGRiwrm(griwrm) } \arguments{ -\item{griwrm}{} +\item{griwrm}{Network description (See \link{CreateGRiwrm})} } \value{ - +\code{GRiwrm} object with connections of the reservoirs to the Seine network } \description{ -Title +Add Seine lakes-reservoirs to the \code{GRiwrm} object } diff --git a/man/addReservoirsQ.Rd b/man/addReservoirsQ.Rd index c72cbf6f518e156b96683f90f755cf4bd7cab524..6c8b8072f0c4f2190a7603431bf6d4e371fb039e 100644 --- a/man/addReservoirsQ.Rd +++ b/man/addReservoirsQ.Rd @@ -2,16 +2,18 @@ % Please edit documentation in R/addReservoirsQ.R \name{addReservoirsQ} \alias{addReservoirsQ} -\title{Title} +\title{Add recorded flows on Seine Grands Lacs reservoir connections to a \code{BasinsObs} database} \usage{ addReservoirsQ(BasinsObs, cfg = loadConfig()) } \arguments{ -\item{path_data}{} +\item{BasinsObs}{an object of class \emph{BasinsObs}, see \link{loadBasinsObs} and \link{createBasinsObs}} + +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ - +a \code{BasinsObs} object completed with recorded flows at reservoir connections } \description{ -Title +Add recorded flows on Seine Grands Lacs reservoir connections to a \code{BasinsObs} database } diff --git a/man/areaPoly.Rd b/man/areaPoly.Rd index 3c548e45d3087351402d4387002603f19372bf90..3926a3fe04df353a53fe85af182b67f7148953ec 100644 --- a/man/areaPoly.Rd +++ b/man/areaPoly.Rd @@ -7,13 +7,13 @@ areaPoly(sp.object = NULL) } \arguments{ -\item{sp.object}{`SpatialPolygonsDataFrame`, must be a `SpatialPolygonsDataFrame` object} +\item{sp.object}{\code{SpatialPolygonsDataFrame}, must be a \code{SpatialPolygonsDataFrame} object} } \value{ a numeric vector } \description{ -Calculates the area of each polygon in [sp::SpatialPolygonsDataFrame]. +Calculates the area of each polygon in \link[sp:SpatialPolygons]{sp::SpatialPolygonsDataFrame}. } \note{ Copied from the UScensus2010 package diff --git a/man/calcQJXA.Rd b/man/calcQJXA.Rd index cf3e6eb966dcb932c05cd914376564fcfb395a82..d93415fa937332489afba1e05f05313e6880faab 100644 --- a/man/calcQJXA.Rd +++ b/man/calcQJXA.Rd @@ -9,21 +9,21 @@ \usage{ calcQJXA(x, ...) -\method{calcQJXA}{data.frame}(x) +\method{calcQJXA}{data.frame}(x, ...) -\method{calcQJXA}{OutputsModel}(x) +\method{calcQJXA}{OutputsModel}(x, ...) -\method{calcQJXA}{POSIXt}(x, flows) +\method{calcQJXA}{POSIXt}(x, flows, ...) } \arguments{ -\item{x}{[POSIXt] dates, or [data.frame] with a first column with dates, or \code{OutputsModel} produced by [airGR::RunModel]} +\item{x}{\link{POSIXt} dates, or \link{data.frame} with a first column with dates, or \code{OutputsModel} produced by \link[airGR:RunModel]{airGR::RunModel}} -\item{flows}{[numeric] flows in l/s for use with x as a [POSIXt]} +\item{...}{for S3 method compability} -\item{pRet}{[numeric] return period in years} +\item{flows}{\link{numeric} flows in l/s for use with x as a \link{POSIXt}} } \value{ -A [vector] of [numeric] for x [POSIXt] or \code{OutputsModel} and a [data.frame] for x [data.frame] +A \link{vector} of \link{numeric} for x \link{POSIXt} or \code{OutputsModel} and a \link{data.frame} for x \link{data.frame} } \description{ Calculation of Maximum daily flow per year. diff --git a/man/calcQJXAn.Rd b/man/calcQJXAn.Rd index 16268e1e2fad2c8952c9a684225737d9941f6d2f..627379b66c112938bb46d049430584596e544b3c 100644 --- a/man/calcQJXAn.Rd +++ b/man/calcQJXAn.Rd @@ -16,12 +16,12 @@ calcQJXAn(x, return_period) \method{calcQJXAn}{GumbelParams}(x, return_period) } \arguments{ -\item{return_period}{[numeric] Return period. Its unit is given by the aggregation time step used for the Gumbel law.} +\item{return_period}{\link{numeric} Return period. Its unit is given by the aggregation time step used for the Gumbel law.} -\item{gumbel}{A [list] with `a` the location parameter and `b` the scale parameter} +\item{gumbel}{A \link{list} with \code{a} the location parameter and \code{b} the scale parameter} } \value{ -A [numeric] with the calculated flow +A \link{numeric} with the calculated flow } \description{ Compute the flow for a given Gumbel law diff --git a/man/calcQLogNn.Rd b/man/calcQLogNn.Rd index 6c22ebf5e6dc6aeac23a5e3ac07a96d3dae5baef..bc6cd0c20ef7eedc31fe2deec80acc6ff60335d4 100644 --- a/man/calcQLogNn.Rd +++ b/man/calcQLogNn.Rd @@ -7,9 +7,9 @@ calcQLogNn(x, return_period) } \arguments{ -\item{x}{[numeric] vector of annual data to process} +\item{x}{\link{numeric} vector of annual data to process} -\item{return_period}{[numeric] Return period in years} +\item{return_period}{\link{numeric} Return period in years} } \value{ The value for the return period according to Galton distribution diff --git a/man/calcQMNA.Rd b/man/calcQMNA.Rd index 100dfedee67bcd2f10e620e596821313b8d66959..f46755309f587535373d332b4fe08252d47ad130 100644 --- a/man/calcQMNA.Rd +++ b/man/calcQMNA.Rd @@ -16,12 +16,12 @@ calcQMNA(x, ...) \method{calcQMNA}{POSIXt}(x, flows) } \arguments{ -\item{x}{either [POSIXt] dates, or a [data.frame] with a first column of [POSIXt] dates and flows in the other columns, or a \code{airGR::OutputsModel} which is an output of [airGR::RunModel()]} +\item{x}{either \link{POSIXt} dates, or a \link{data.frame} with a first column of \link{POSIXt} dates and flows in the other columns, or a \code{airGR::OutputsModel} which is an output of \code{\link[airGR:RunModel]{airGR::RunModel()}}} -\item{flows}{[numeric] flows in l/s} +\item{flows}{\link{numeric} flows in l/s} } \value{ -[numeric] a numeric value of QMNA +\link{numeric} a numeric value of QMNA } \description{ Calculation of QMNAs (annual minimum of mean monthly flows) diff --git a/man/calcQMNAn.Rd b/man/calcQMNAn.Rd index ad84825ba1cf0c7d9f80b463e72797a726e3b1ba..65eaf9c4035a829ded871df274aaa052fe253ad1 100644 --- a/man/calcQMNAn.Rd +++ b/man/calcQMNAn.Rd @@ -13,22 +13,21 @@ calcQMNAn(x, return_period) \method{calcQMNAn}{data.frame}(x, return_period) } \arguments{ -\item{x}{[numeric] vector of mean monthly flows} +\item{x}{\link{numeric} vector of mean monthly flows} -\item{return_period}{[numeric] number of years} +\item{return_period}{\link{numeric} number of years} } \value{ -[numeric] QMNA for the given return period +\link{numeric} QMNA for the given return period } \description{ Calculation of QMNA according to a return period. An adjustment to a Galton distribution (log-normal distribution) is realised. } \examples{ -# First calculation of QMNAs (Minimum monthly flow for each year) -example("calcQMNA") +#! load data +data(L0123001, package = "airGR") -# Second calculation of QMNA for a given return period -calcQMNAn(QMNA_Obs, 5) -calcQMNAn(QMNA_GR4J, 5) +dfQ <- data.frame(DatesR = BasinObs$DatesR, Q = BasinObs$Qls / 1000) +calcQMNAn(dfQ, 5) } diff --git a/man/calcVCN.Rd b/man/calcVCN.Rd index 5e33181e19d6845d32ae7772472383730221dffd..8e95c2d68e08dc01ed92b43d23a348d89ddcd8c3 100644 --- a/man/calcVCN.Rd +++ b/man/calcVCN.Rd @@ -13,14 +13,14 @@ calcVCN(x, k, ...) \method{calcVCN}{numeric}(x, k, ...) } \arguments{ -\item{x}{[numeric] or [matrix] for respectively a time series and several times series} +\item{x}{\link{numeric} or \link{matrix} for respectively a time series and several times series} -\item{k}{[numeric] period in days} +\item{k}{\link{numeric} period in days} -\item{...}{further parameters to send to [zoo::rollmean]} +\item{...}{further parameters to send to \link[zoo:rollmean]{zoo::rollmean}} } \value{ -A 1-length [numeric] for a single time series, a [numeric] otherwise. +A 1-length \link{numeric} for a single time series, a \link{numeric} otherwise. } \description{ VCN means "Volume Consécutif Minimal" in French :) diff --git a/man/calcVCNn.Rd b/man/calcVCNn.Rd index e2f0016e99f0c5a9ffd9d35af920e4e394d3951d..6bcb1e339f4f6f8c343a0006426f9b93cd468721 100644 --- a/man/calcVCNn.Rd +++ b/man/calcVCNn.Rd @@ -10,22 +10,22 @@ calcVCNn(x, k, return_period, ...) \method{calcVCNn}{data.frame}(x, k, return_period, ...) } \arguments{ -\item{x}{[numeric] vector of VCN of one year} +\item{x}{\link{numeric} vector of VCN of one year} -\item{return_period}{[numeric] number of years} +\item{return_period}{\link{numeric} number of years} } \value{ -[numeric] VCN for the given return period +\link{numeric} VCN for the given return period } \description{ Calculation of VCN according to a return period. An adjustment to a Galton distribution (log-normal distribution) is realised. } \examples{ -# First calculation of QMNAs (Minimum monthly flow for each year) -example("calcQMNA") +#! load data +data(L0123001, package = "airGR") +dfQ <- data.frame(DatesR = BasinObs$DatesR, Q = BasinObs$Qls / 1000) -# Second calculation of QMNA for a given return period -calcQMNAn(QMNA_Obs, 5) -calcQMNAn(QMNA_GR4J, 5) +# VCN10 return period of 2 years +calcVCNn(dfQ, 10, 5) } diff --git a/man/climato_safran2bvi.Rd b/man/climato_safran2bvi.Rd index f8be0c78c06ea575bbb9e840d45227a1c67d39b6..9a80572d13258bcce4840c853620fdd1f958b647 100644 --- a/man/climato_safran2bvi.Rd +++ b/man/climato_safran2bvi.Rd @@ -2,16 +2,18 @@ % Please edit documentation in R/climato_safran2bvi.R \name{climato_safran2bvi} \alias{climato_safran2bvi} -\title{Title} +\title{Convert a data from a SAFRAn grid to BVI scale} \usage{ climato_safran2bvi(safran, dfMailles) } \arguments{ -\item{cfg}{} +\item{safran}{data in SAFRAn format} + +\item{dfMailles}{correspondence between SAFRAN grid and BVIs} } \value{ - +\link{matrix} } \description{ -Title +Convert a data from a SAFRAn grid to BVI scale } diff --git a/man/createBasinsObs.Rd b/man/createBasinsObs.Rd index 50c19410bcb086c3dce98bbd45c65bbcd253a040..ba822f022231df8ee3280a9026d863460821dd13 100644 --- a/man/createBasinsObs.Rd +++ b/man/createBasinsObs.Rd @@ -2,23 +2,24 @@ % Please edit documentation in R/createBasinsObs.R \name{createBasinsObs} \alias{createBasinsObs} -\title{Create an object `BasinsObs`} +\title{Create an object \code{BasinsObs} from SAFRAN grid} \usage{ createBasinsObs(files, dfMailles, cfg = loadConfig()) } \arguments{ -\item{files}{[character] containing list of NetCFD DRIAS2020 files to read for precipitation and evaporation and for both historical and RCP periods for a given climatic scenario} +\item{files}{\link{character} containing list of NetCFD DRIAS2020 files to read for precipitation and evaporation and for both historical and RCP periods for a given climatic scenario} -\item{dfMailles}{[data.frame] with correspondence between SAFRAN cells and intermediate basins} +\item{dfMailles}{\link{data.frame} with correspondence between SAFRAN cells and intermediate basins} } \value{ -A [list] of class `BasinsObs` containing: - -- `DatesR`: [POSIXt] vector of dates required to create the GR model and CemaNeige module inputs -- `P`: [matrix] containing precipitation in \[mm per time step\]. Column names correspond to node IDs -- `Temp`: [matrix] containing mean temperature in \[°C\]. Column names correspond to node IDs -- `E`: [matrix] containing potential evaporation in \[mm per time step\]. Column names correspond to node IDs +A \link{list} of class \code{BasinsObs} containing: +\itemize{ +\item \code{DatesR}: \link{POSIXt} vector of dates required to create the GR model and CemaNeige module inputs +\item \code{P}: \link{matrix} containing precipitation in [mm per time step]. Column names correspond to node IDs +\item \code{Temp}: \link{matrix} containing mean temperature in [°C]. Column names correspond to node IDs +\item \code{E}: \link{matrix} containing potential evaporation in [mm per time step]. Column names correspond to node IDs +} } \description{ -Create an object `BasinsObs` +Create an object \code{BasinsObs} from SAFRAN grid } diff --git a/man/getAprioriIds.Rd b/man/getAprioriIds.Rd index 09ffa94d62aa93318174304b69373b61ddec7091..97cb87d8e190224a4e1482db0ecb436801cbc97e 100644 --- a/man/getAprioriIds.Rd +++ b/man/getAprioriIds.Rd @@ -2,16 +2,17 @@ % Please edit documentation in R/getAprioriIds.R \name{getAprioriIds} \alias{getAprioriIds} -\title{Title} +\title{Selection of upstream gauging stations as a priori for Lavenne regularisation} \usage{ getAprioriIds(InputsModel) } \arguments{ -\item{InputsModel}{} +\item{InputsModel}{an object of class \emph{GRiwrmInputsModel}, see \link{CreateInputsModel.BasinsObs}} } \value{ - +\link{character} named \link{vector} with each item defined as follow: station ID as key and upstream a priori station ID as value. } \description{ -Title +This function selects, for each gauging station, which direct upstream gauging station bring the maximum mean flow. +The calibration parameters of this station will be used as "a priori" parameter for the current gauging station (See \link[airGR:CreateInputsCrit_Lavenne]{airGR::CreateInputsCrit_Lavenne}) } diff --git a/man/getDataPath.Rd b/man/getDataPath.Rd index 4183b3374cde729ecbbc8a8f34af7695d675c53d..d04b5a6d88ad73f285a8e06427d9712eb42dd9ac 100644 --- a/man/getDataPath.Rd +++ b/man/getDataPath.Rd @@ -13,23 +13,15 @@ getDataPath( ) } \arguments{ -\item{path}{[character] representing the path of the data in the database} +\item{path}{\link{character} representing the path of the data in the database} -\item{download}{download a URL in a temporary file? (Default `FALSE`)} +\item{download}{download a URL in a temporary file? (Default \code{TRUE})} -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ -[character] with the path of the file to read +\link{character} with the path of the file to read } \description{ -If the database is a URL, this function can download the file in a temporary folder and returns the path of the downloaded file. This functionality is useful for [readxl::read_excel] (See: https://stackoverflow.com/a/41368947/5300212). -} -\examples{ -com_france <- readxl::read_excel( - getDataPath("usages/territoire/table-appartenance-geo-communes-16.xls", download = TRUE), - sheet = "COM", - skip = 5 -) -str(com_france) +If the database is a URL, this function can download the file in a temporary folder and returns the path of the downloaded file. This functionality is useful for \link[readxl:read_excel]{readxl::read_excel} (See: https://stackoverflow.com/a/41368947/5300212). } diff --git a/man/getDrias2020filenames.Rd b/man/getDrias2020filenames.Rd index fd1b4ef3b8c4093a692b65f4aef6bb51ea38f9c4..11bc9ac9f0a5ed33047965cc7866dc52e48c0893 100644 --- a/man/getDrias2020filenames.Rd +++ b/man/getDrias2020filenames.Rd @@ -7,17 +7,18 @@ getDrias2020filenames(scenario, scenario_data_files) } \arguments{ -\item{scenario}{[character] Scenario name in format "GCM/RCM"} +\item{scenario}{\link{character} Scenario name in format "GCM/RCM"} -\item{scenario_data_files}{[character] Names of DRIAS 2020 netCDF files} +\item{scenario_data_files}{\link{character} Names of DRIAS 2020 netCDF files} } \value{ -A [character] vector of selected DRIAS 2020 files +A \link{character} vector of selected DRIAS 2020 files } \description{ Extract the names of the files concerned by a GCM/RCM scenario } \examples{ +cfg <- loadConfig() driasFiles <- listDataFiles(file.path(cfg$hydroclim$path, "drias")) getDrias2020filenames("HadGEM2-ES/CCLM4-8-17", driasFiles) diff --git a/man/getGumbelParams.Rd b/man/getGumbelParams.Rd index ddc3f762a2247a24cb3a3ffea66c99fd230a0339..021bec33f5ac248c27c436ad10d9e3b464f13a96 100644 --- a/man/getGumbelParams.Rd +++ b/man/getGumbelParams.Rd @@ -10,7 +10,7 @@ getGumbelParams(x) \item{x}{Maximum flow at a given time step (usually the maximum daily flow per year)} } \value{ -A [list] with `a` the location parameter and `b` the scale parameter +A \link{list} with \code{a} the location parameter and \code{b} the scale parameter } \description{ Compute Gumbel's laws parameters diff --git a/man/gis_bvi.Rd b/man/gis_bvi.Rd index 061c55ae3a00216545b340285c42aba9aadd732b..c0bc097a366438c354e6fc1eabef2b0f3bafd7a7 100644 --- a/man/gis_bvi.Rd +++ b/man/gis_bvi.Rd @@ -5,7 +5,7 @@ \alias{gis_bvi} \title{GIS layer of intermediate water basins of the Seine basin.} \format{ -A [sp::SpatialPolygonsDataFrame] object with the intermediate water basins +A \link[sp:SpatialPolygons]{sp::SpatialPolygonsDataFrame} object with the intermediate water basins } \usage{ gis_bvi diff --git a/man/griwrm.Rd b/man/griwrm.Rd index 95e6ad943925456e80c73ce9de6683c1a0d0a991..d5c6fd5704691e47818fe647aa1617fc23d6478c 100644 --- a/man/griwrm.Rd +++ b/man/griwrm.Rd @@ -5,7 +5,7 @@ \alias{griwrm} \title{Description of the semi-distributed network of the Seine basin gauging stations} \format{ -A GRiwrm object created by [airGRiwrm:CreateGRiwrm] +A GRiwrm object created by \link[airGRiwrm:CreateGRiwrm]{airGRiwrm::CreateGRiwrm} } \usage{ griwrm diff --git a/man/hello.Rd b/man/hello.Rd deleted file mode 100644 index 0fa7c4b8817591c2dff2b3997d2566320ac6d9fc..0000000000000000000000000000000000000000 --- a/man/hello.Rd +++ /dev/null @@ -1,12 +0,0 @@ -\name{hello} -\alias{hello} -\title{Hello, World!} -\usage{ -hello() -} -\description{ -Prints 'Hello, world!'. -} -\examples{ -hello() -} diff --git a/man/listDataFiles.Rd b/man/listDataFiles.Rd index 28f5ebf67308ed65f3da42476421387e50cf26c4..745356a327343d1b9f6cd0142348d633114a8b7e 100644 --- a/man/listDataFiles.Rd +++ b/man/listDataFiles.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/listDataFiles.R \name{listDataFiles} \alias{listDataFiles} -\title{Wrapper of [base::list.files] for handling cloud storage} +\title{Wrapper of \link[base:list.files]{base::list.files} for handling cloud storage} \usage{ listDataFiles(path, cfg = loadConfig(), ...) } @@ -10,11 +10,17 @@ listDataFiles(path, cfg = loadConfig(), ...) \item{path}{a character vector of full path names; the default corresponds to the working directory, getwd().} -\item{...}{Further parameters pass to [base::list.files]} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} + +\item{...}{Further parameters pass to \link[base:list.files]{base::list.files}} } \value{ - +\link{character} \link{vector} with the file names } \description{ -Wrapper of [base::list.files] for handling cloud storage +Wrapper of \link[base:list.files]{base::list.files} for handling cloud storage +} +\examples{ +cfg <- loadConfig() +listDataFiles(cfg$hydroclim$path) } diff --git a/man/loadBasinsObs.Rd b/man/loadBasinsObs.Rd index 4de821811d0455a738e17e2ce7ee69544cfca910..c1eb39de41046a013cea7064b9d62740513c3cb2 100644 --- a/man/loadBasinsObs.Rd +++ b/man/loadBasinsObs.Rd @@ -7,15 +7,20 @@ loadBasinsObs(RDataFile, griwrm = NULL, cfg = loadConfig()) } \arguments{ -\item{RDataFile}{path of the file inside `cfg$hydroclim$path`} +\item{RDataFile}{path of the file inside \code{cfg$hydroclim$path}} -\item{griwrm}{GRiwrm object describing the semi-distributed network (default `data("griwrm")`, see [griwrm])} +\item{griwrm}{GRiwrm object describing the semi-distributed network (default \code{data("griwrm")}, see \link{griwrm})} -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ - +A \code{BasinsObs} object (See \link{createBasinsObs}) } \description{ Load observations for the semi-distributed model } +\examples{ +BasinsObs <- loadBasinsObs("BasinsObs_observations_day_1958-2019.RDS") +str(BasinsObs) + +} diff --git a/man/loadCalibrationParams.Rd b/man/loadCalibrationParams.Rd index 1825d70a2eb27ef69694fdd387ede1bca3a6b0a0..d8f1d6d355d9fdf6d44a407e83f6156275f14018 100644 --- a/man/loadCalibrationParams.Rd +++ b/man/loadCalibrationParams.Rd @@ -2,16 +2,21 @@ % Please edit documentation in R/loadCalibrationParams.R \name{loadCalibrationParams} \alias{loadCalibrationParams} -\title{Title} +\title{Load model calibration parameter} \usage{ loadCalibrationParams(fileName, cfg = loadConfig()) } \arguments{ -\item{cfg}{} +\item{fileName}{name of the file containing the calibration parameters (See \link{Calibration.BasinsObs})} + +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ - +\link{list} with one item by gauging station containing a \link{numeric} \link{vector} of parameters } \description{ -Title +Load model calibration parameter +} +\details{ +This function is essentially called by \link{RunModel.BasinsObs}. } diff --git a/man/loadConfig.Rd b/man/loadConfig.Rd index 242d89ac59818fa8e0e6d062f4aece0093923762..705e8632470770fd0822e6bfe98831f00acb1162 100644 --- a/man/loadConfig.Rd +++ b/man/loadConfig.Rd @@ -15,7 +15,7 @@ loadConfig( \item{pathDefaultCfg}{The location of the default configuration (located in "inst/config.yml" of the package by default)} } \value{ -A configuration as it is returned by [config::get] +A configuration as it is returned by \link[config:get]{config::get} } \description{ Read default configuration of the package and complete it with eventual user config diff --git a/man/loadHydratecDB.Rd b/man/loadHydratecDB.Rd index 3a7461e42c81fa5adcc7f3443d615a28c48824ff..237c512d39e51d22f0f80ab9d305645e14d85bb8 100644 --- a/man/loadHydratecDB.Rd +++ b/man/loadHydratecDB.Rd @@ -10,12 +10,12 @@ Hydratec. 2011. Actualisation de la base de données des débits journaliers ‘ loadHydratecDB(cfg = loadConfig()) } \arguments{ -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ -A [list] with 2 items: - - `stations`: a [data.frame] with the description of gauging stations - - `Q`: the times series of daily flows +A \link{list} with 2 items: +- \code{stations}: a \link{data.frame} with the description of gauging stations +- \code{Q}: the times series of daily flows } \description{ Load Hydratec naturalised flow database diff --git a/man/loadHypsoData.Rd b/man/loadHypsoData.Rd index 60491c3e60d07c0f6e7fb96fa2a13c76b12a4f32..a22e01384d1396dbc9a1ee3a2fb9a852df092b86 100644 --- a/man/loadHypsoData.Rd +++ b/man/loadHypsoData.Rd @@ -2,16 +2,17 @@ % Please edit documentation in R/loadHypsoData.R \name{loadHypsoData} \alias{loadHypsoData} -\title{Title} +\title{Load hypsometric data for Cemaneige snow module} \usage{ loadHypsoData(cfg = loadConfig()) } \arguments{ -\item{data_path}{} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ - +\link{matrix} with one column by gauging station } \description{ -Title +Read all the files contained in the folder \code{cfg$hydroclim$path}/courbes_hypsometriques +and merge them into a matrix } diff --git a/man/readDrias2020.Rd b/man/readDrias2020.Rd index 0c324b88d96cb7ff6ab79bb889277bc44b754388..307e78d5a728521317c4d3a8b2187adca3feebc9 100644 --- a/man/readDrias2020.Rd +++ b/man/readDrias2020.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/readDrias2020.R \name{readDrias2020} \alias{readDrias2020} -\title{Read "Simulations 'DRIAS-2020': données quotidiennes corrigées \[format Netcdf\]" files} +\title{Read "Simulations 'DRIAS-2020': données quotidiennes corrigées [format Netcdf]" files} \usage{ readDrias2020( files, @@ -11,23 +11,29 @@ readDrias2020( ) } \arguments{ -\item{files}{[character] One or more file names to read without the path} +\item{files}{\link{character} One or more file names to read without the path} + +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} \item{path}{the path of the files} } \value{ -A [list] containing items: - - `var` [character] the name of the variable - - `DatesR` a [POSIXct] with the dates of data - - `cells` a [list] containing one item by cell +A \link{list} containing items: +\itemize{ +\item \code{var} \link{character} the name of the variable +\item \code{DatesR} a \link{POSIXct} with the dates of data +\item \code{cells} a \link{list} containing one item by cell +} -Each cell is then a [list] with 2 items: - - `xy`: a [vector] of lenght 2 : coordinates of the cell-centroid in Lambert II projection - - `data`: a [vector] of the same lenght as `DatesR` with the meteorological time series +Each cell is then a \link{list} with 2 items: +\itemize{ +\item \code{xy}: a \link{vector} of lenght 2 : coordinates of the cell-centroid in Lambert II projection +\item \code{data}: a \link{vector} of the same lenght as \code{DatesR} with the meteorological time series +} } \description{ -Read "Simulations 'DRIAS-2020': données quotidiennes corrigées \[format Netcdf\]" files +Read "Simulations 'DRIAS-2020': données quotidiennes corrigées [format Netcdf]" files } \details{ -`files` could be a vector with the "Historical" and the "rcpn.n" files, the two times series are then merged into a continuous one. +\code{files} could be a vector with the "Historical" and the "rcpn.n" files, the two times series are then merged into a continuous one. } diff --git a/man/readQsim.Rd b/man/readQsim.Rd index 3ed035005e13032a56f4ca62bd6a707de530e966..6f2951b5ed7e2dc189bbfeb910f7397d015347f8 100644 --- a/man/readQsim.Rd +++ b/man/readQsim.Rd @@ -2,20 +2,20 @@ % Please edit documentation in R/loadQsim.R \name{readQsim} \alias{readQsim} -\title{Load simulated flows recorded with [saveFlowDB]} +\title{Load simulated flows recorded with \link{saveFlowDB}} \usage{ readQsim(..., cfg = loadConfig()) } \arguments{ -\item{...}{[character] the relative path where the database is recorded in the cloud} +\item{...}{\link{character} the relative path where the database is recorded in the cloud} -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ -A [data.frame] with a first column with the date and following columns the daily mean simulated flows for each station. +A \link{data.frame} with a first column with the date and following columns the daily mean simulated flows for each station. } \description{ -Load simulated flows recorded with [saveFlowDB] +Load simulated flows recorded with \link{saveFlowDB} } \examples{ cfg <- loadConfig() diff --git a/man/saveFlowDB.Rd b/man/saveFlowDB.Rd index 27f951f41717576de35303a031a086b827aecac7..82753abc186ce97eb794ea4d82e7104db4331218 100644 --- a/man/saveFlowDB.Rd +++ b/man/saveFlowDB.Rd @@ -7,16 +7,16 @@ saveFlowDB(path, InputsModel, OutputsModel, cfg = loadConfig()) } \arguments{ -\item{path}{[character] the location used to save the database} +\item{path}{\link{character} the location used to save the database} -\item{InputsModel}{[GRiwrmInputsModel] see [CreateInputsModel.BasinsObs]} +\item{InputsModel}{\code{GRiwrmInputsModel} object. See \link{CreateInputsModel.BasinsObs}} -\item{OutputsModel}{[GriwrmOutputsModel] see [RunModel.BasinsObs]} +\item{OutputsModel}{\code{GriwrmOutputsModel} object. See \link{RunModel.BasinsObs}} -\item{cfg}{a [config] object. Configuration to use. See [LoadConfig] for details} +\item{cfg}{a config object. Configuration to use. See \link{loadConfig} for details} } \value{ - +\code{TRUE} if the last copy successed } \description{ Save database of one simulation diff --git a/man/selectBasins.Rd b/man/selectBasins.Rd deleted file mode 100644 index a36bacfc2c8ae037adac6a10e2ca24e8d17c5ea5..0000000000000000000000000000000000000000 --- a/man/selectBasins.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/selectBasins.R -\name{selectBasins} -\alias{selectBasins} -\title{Title} -\usage{ -selectBasins(BasinsObs, ids) -} -\arguments{ -\item{ids}{} -} -\value{ - -} -\description{ -Title -}