Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
IN-WOP
SeineBasin2
Commits
2250d47d
Commit
2250d47d
authored
Jan 21, 2022
by
Dorchies David
Browse files
feat(06-evolution): add obs, sim and nat values in delta tables
Refs
#12
parent
a251d51d
Pipeline
#32068
passed with stages
in 33 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bookdown/06-evolution_indicateurs_hydrologiques.Rmd
View file @
2250d47d
...
...
@@ -117,6 +117,12 @@ Pour les débits :
Ces données ont été calculées et enregistrées lors de la simulation des débits.
```{r}
readTsvMatrix <- function(path) {
df <- read.csv(path, sep = "\t")
m <- as.matrix(df[,-1])
rownames(m) <- df[, 1]
m
}
loadIndicators <- function(rcp, scenario, indicator) {
periods <- names(cfg$hydroclim$drias$periods)
names(periods) <- periods
...
...
@@ -134,10 +140,7 @@ loadIndicators <- function(rcp, scenario, indicator) {
file,
cfg = cfg
)
df <- read.csv(path, sep = "\t")
m <- as.matrix(df[, -1])
rownames(m) <- df[, 1]
m
readTsvMatrix(path)
})
}
...
...
@@ -177,6 +180,31 @@ Les données utilisées en entrées sont :
- données simulées sur la période d'observation
- Rapport entre les données simulées sur la période future et la période de référence pour un couple scénario/modèle climatique
```{r}
historiQ <- list(
obs = list(path = file.path(cfg$calibration$path, "Qobs"),
period = c(cfg$calibration$date$start, cfg$calibration$date$end)),
sim = list(path = file.path(cfg$calibration$path, "Qsim"),
period = c(cfg$calibration$date$start, cfg$calibration$date$end)),
nat = list(path = file.path(cfg$Qnat$path, "Qnat-v1"),
period = cfg$hydroclim$drias$periods$ref)
)
loadHistoriQ <- function(l, indicator) {
file <- paste0(indicator, "_",
substr(l$period[1], 1, 4),
"-",
substr(l$period[2], 1, 4),
".tsv")
path <- getDataPath(l$path, file, cfg = cfg)
readTsvMatrix(path)
}
Qhist_month <- lapply(historiQ, loadHistoriQ, indicator = "Q_monthly")
Qhist_month5 <- lapply(historiQ, loadHistoriQ, indicator = "Q_monthly_5years")
Qhist_indicators <- lapply(historiQ, loadHistoriQ, indicator = "Q_indicators")
```
Les tableaux de synthèse fournissent la valeur minimale, médiane et maximale des évolutions parmi les couples scénario/modèle climatiques.
```{r}
...
...
@@ -208,7 +236,8 @@ calcDelta <- function(ind, rcp, period, delta = "*") {
max = do.call(pmax, deltas)
)
}
tableDeltaStation <- function(station, delta) {
tableDeltaStation <- function(station, delta, ind_hist = NULL) {
if (!is.null(ind_hist)) delta <- c(ind_hist, delta)
l <- lapply(delta, function(m) {
m[station, ]
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment