Commit 2ea1ffd6 authored by Dorchies David's avatar Dorchies David
Browse files

feat(performance map): improvments

- centering color around indicator = 1
- add rivers and main towns

Refs #5
parent 960242bd
Pipeline #31763 failed with stages
in 14 minutes and 11 seconds
......@@ -27,7 +27,7 @@ calcVCN.matrix <- function(x, k, ...) {
#' @export
calcVCN.numeric <- function(x, k, ...) {
slideMean <- zoo::rollmean(x, k, ...)
return(min(slideMean))
return(suppressWarnings(min(slideMean)))
}
#' VCNn for a given return period
......
......@@ -10,6 +10,19 @@
#'
"gis_bvi"
#' GIS layer of main rivers of the Seine basin.
#'
#' @format A [sf::sfc_LINESTRING] object
#' @source IGN, France
#'
"gis_rivers"
#' GIS layer of main cities of the Seine basin.
#'
#' @format A [sf::sfc_POINT] object
#' @source IGN, France
#'
"gis_villes"
#' Description of the semi-distributed network of the Seine basin gauging stations
#'
......
......@@ -88,11 +88,62 @@ getMapRatio <- function(Qsim, Qobs, FUN, varTitle) {
sf_bvi <- st_as_sf(gis_bvi)
sf_bvi$ratio <- r[sf_bvi$CODE]
# Define scale centered around 1
decVal <- r[r < 1]
incVal <- r[!(r < 1)]
decQuant <- quantile(decVal, probs = c(0, 0.1, 0.4, 0.6, 0.9))
incQuant <- quantile(incVal, probs = c(0.1, 0.4, 0.6, 0.9, 1))
breaks <- c(decQuant, incQuant)
#mf_init(x = st_union(sf_bvi), "brutal")
mf_map(x = sf_bvi,
var = "ratio",
type = "choro",
pal = "RdYlBu")
mf_layout(title = varTitle)
pal = "RdYlBu",
breaks = breaks)
# Add river network
mf_map(gis_rivers, type = "base", col = "royalblue", add = TRUE)
# Add main cities
data(gis_villes)
mf_label(x = gis_villes, var = "X1",
cex = 0.5, halo = TRUE, r = 0.10)
# Add label for lakes
lac <- data.frame(x = c(780355.2, 760259.1, 749809.1, 719263.0),
y = c(2401371, 2376452, 2366806, 2238994),
name = c("Lac Marne", "Lac Aube", "Lac Seine", "Lac Yonne"),
zz = 1)
sf_lac <- st_as_sf(lac, coords = c("x", "y"), crs = 27572)
mf_map(sf_lac, var = "zz", type = "symb", pal = "red", leg_pos = NA)
mf_label(x = sf_lac, var = "name", col = "navyblue",
cex = 0.65, halo = TRUE, r = 0.10, pos = 4)
legend(
"bottomleft",
legend = "Lacs reservoirs",
pch = 22,
pt.lwd = 1,
pt.cex = 1.2,
pt.bg = "lightgrey",
col = "red",
cex = 0.8,
bty = "n",
inset = c(0.2, 0.06)
)
legend(
"bottomleft",
legend = "Hydrographie",
lty = 1,
seg.len = 1,
col = "royalblue",
cex = 0.8,
bty = "n",
inset = c(0.18, 0)
)
mf_layout(title = varTitle,
credits = "Inrae")
}
Qobs <- cbind(DatesR = BasinsObs$DatesR, BasinsObs$Q)
Qsim <- cbind(DatesR = OM_with[[1]]$DatesR, as.data.frame(do.call(cbind, lapply(OM_with, "[[", "Qsim"))))
......@@ -119,3 +170,14 @@ calcVCN30Y2 <- function(x) {
}
getMapRatio(Qsim, Qobs, calcVCN30Y2, "R-VCN30-2")
```
## QMNA5&nbsp;: Débit moyen mensuel minimum de période de retour 5 ans
```{r}
calcQMNA5 <- function(x) {
calcQMNAn(x, 5)
}
getMapRatio(Qsim, Qobs, calcQMNA5, "R-QMNA5")
plot(gis_rivers[as.numeric(gis_rivers$classifica) < 5, "classifica"])
plot(gis_rivers[, "classifica"])
```
......@@ -67,4 +67,22 @@
file = {C\:\\Users\\david.dorchies\\Zotero\\storage\\9ENK4C92\\Oudin et al. - 2005 - Which potential evapotranspiration input for a lum.pdf}
}
@article{verfaillieMethodADAMONTV12017,
title = {The Method {{ADAMONT}} v1.0 for Statistical Adjustment of Climate Projections Applicable to Energy Balance Land Surface Models},
author = {Verfaillie, Deborah and Déqué, Michel and Morin, Samuel and Lafaysse, Matthieu},
date = {2017-11-24},
journaltitle = {Geoscientific Model Development},
volume = {10},
number = {11},
pages = {4257--4283},
publisher = {{Copernicus GmbH}},
issn = {1991-959X},
doi = {10.5194/gmd-10-4257-2017},
url = {https://gmd.copernicus.org/articles/10/4257/2017/},
urldate = {2021-11-29},
abstract = {{$<$}p{$><$}strong class="journal-contentHeaderColor"{$>$}Abstract.{$<$}/strong{$>$} We introduce the method ADAMONT v1.0 to adjust and disaggregate daily climate projections from a regional climate model (RCM) using an observational dataset at hourly time resolution. The method uses a refined quantile mapping approach for statistical adjustment and an analogous method for sub-daily disaggregation. The method ultimately produces adjusted hourly time series of temperature, precipitation, wind speed, humidity, and short- and longwave radiation, which can in turn be used to force any energy balance land surface model. While the method is generic and can be employed for any appropriate observation time series, here we focus on the description and evaluation of the method in the French mountainous regions. The observational dataset used here is the SAFRAN meteorological reanalysis, which covers the entire French Alps split into 23 massifs, within which meteorological conditions are provided for several 300 m elevation bands. In order to evaluate the skills of the method itself, it is applied to the ALADIN-Climate v5 RCM using the ERA-Interim reanalysis as boundary conditions, for the time period from 1980 to 2010. Results of the ADAMONT method are compared to the SAFRAN reanalysis itself. Various evaluation criteria are used for temperature and precipitation but also snow depth, which is computed by the SURFEX/ISBA-Crocus model using the meteorological driving data from either the adjusted RCM data or the SAFRAN reanalysis itself. The evaluation addresses in particular the time transferability of the method (using various learning/application time periods), the impact of the RCM grid point selection procedure for each massif/altitude band configuration, and the intervariable consistency of the adjusted meteorological data generated by the method. Results show that the performance of the method is satisfactory, with similar or even better evaluation metrics than alternative methods. However, results for air temperature are generally better than for precipitation. Results in terms of snow depth are satisfactory, which can be viewed as indicating a reasonably good intervariable consistency of the meteorological data produced by the method. In terms of temporal transferability (evaluated over time periods of 15 years only), results depend on the learning period. In terms of RCM grid point selection technique, the use of a complex RCM grid points selection technique, taking into account horizontal but also altitudinal proximity to SAFRAN massif centre points/altitude couples, generally degrades evaluation metrics for high altitudes compared to a simpler grid point selection method based on horizontal distance.{$<$}/p{$>$}},
langid = {english},
file = {C\:\\Users\\david.dorchies\\Zotero\\storage\\632RTVSW\\Verfaillie et al. - 2017 - The method ADAMONT v1.0 for statistical adjustment.pdf;C\:\\Users\\david.dorchies\\Zotero\\storage\\ISRZINHK\\2017.html}
}
#' Record GIS shape file of river network
# Local config
cfg <- loadConfig("bookdown/config.yml")
# Read Shape file
gis_rivers <- sf::st_read(dsn = getDataPath(cfg$hydroclim$path, "GIS", "Reseau_hydro", cfg = cfg),
layer = "reseau_hydro_BS")
# Set projection to Lambert II
gis_rivers <- st_transform(gis_rivers, crs = st_crs(27572))
# Selection of main rivers
gis_rivers <- gis_rivers[as.numeric(gis_rivers$classifica) < 4, ]
# Crop selection to BV area
data("gis_bvi")
sf_bvi <- st_as_sf(gis_bvi)
gis_rivers <- st_intersection(gis_rivers, st_union(sf_bvi))
gis_rivers <- st_simplify(gis_rivers, dTolerance = 250)
usethis::use_data(gis_rivers, overwrite = TRUE)
#' Record GIS shape file of river network
# Local config
cfg <- loadConfig("bookdown/config.yml")
# Read Shape file
gis_villes <- sf::st_read(dsn = getDataPath(cfg$hydroclim$path, "GIS", "Villes_principales", cfg = cfg),
layer = "Villes_principales")
# Selection of main rivers
gis_villes <- gis_villes[, "X1"]
usethis::use_data(gis_villes, overwrite = TRUE)
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{gis_rivers}
\alias{gis_rivers}
\title{GIS layer of main rivers of the Seine basin.}
\format{
A \link[sf:sfc]{sf::sfc_LINESTRING} object
}
\source{
IGN, France
}
\usage{
gis_rivers
}
\description{
GIS layer of main rivers of the Seine basin.
}
\keyword{datasets}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{gis_villes}
\alias{gis_villes}
\title{GIS layer of main cities of the Seine basin.}
\format{
A \link[sf:sfc]{sf::sfc_POINT} object
}
\source{
IGN, France
}
\usage{
gis_villes
}
\description{
GIS layer of main cities of the Seine basin.
}
\keyword{datasets}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment