View source: R/doQuantileMapping.R
| doQuantileMapping | R Documentation |
Bias correction for climate model output with observations using the package qmap by Lukas Gudmundsson.
doQuantileMapping(hist_obs, hist_sim, fut_sim)
hist_obs |
Tibble with historical observations for 1 or more stations.
The tibble must contain the columns |
hist_sim |
Tibble with simulations of historical time series for the
region of interest.
The tibble must contain the columns |
fut_sim |
Tibble with simulations of future climate in the region of
interest. The tibble must contain the columns |
It is assumed that the observations used for bias correction fit into
one single tile of the climate model output.
Temperatures are transformed to deg K.
NULL for failure.
Other Pre-processing:
convert2HYY(),
gen_HRU_Climate_CSV_RSMinerve(),
gen_basinElevationBands(),
loadTabularData(),
plotNormDevHYY()
hist_obs <- tibble::tribble(~Date, ~Basin, ~Pr,
"1979-01-01", "K_eb1", 0.1,
"1979-01-01", "K_eb2", 0.2,
"1979-01-01", "K_eb3", 0.3,
"1979-01-02", "K_eb1", 0.4,
"1979-01-02", "K_eb2", 0.5,
"1979-01-02", "K_eb3", 0.6) |>
dplyr::mutate(Date = as.Date(Date))
hist_sim <- hist_obs |>
dplyr::filter(Basin == "K_eb1") |>
dplyr::select(-Basin) |>
dplyr::mutate(Pr = Pr + 1, Model = "A")
hist_sim <- hist_sim |>
dplyr::add_row(hist_sim |>
dplyr::mutate(Pr = Pr + 2, Model = "B"))
fut_sim <- hist_sim |>
dplyr::mutate(Scenario = "a") |>
dplyr::add_row(hist_sim |>
dplyr::mutate(Pr = Pr + 1, Scenario = "b"))
fut_sim <- fut_sim |>
dplyr::add_row(fut_sim |>
dplyr::mutate(Date = as.Date(Date) + 2))
results <- doQuantileMapping(hist_obs, hist_sim, fut_sim)
mapped_hist_sim <- results[[1]]
mapped_fut_sim <- results[[2]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.