Commit 12da6ba6 authored by Dorchies David's avatar Dorchies David
Browse files

fix: bug after changes d30c5b1e

Refs #22, #21
1 merge request!10Resolve "Replace vignette examples on Seine River by a fake example from data provided by airGR"
Pipeline #18671 failed with stage
in 8 minutes and 37 seconds
Showing with 4 additions and 1 deletion
+4 -1
......@@ -12,6 +12,7 @@ ConvertMeteoSD <- function(x, ...) {
UseMethod("ConvertMeteoSD")
}
#' @param meteo [matrix] or [data.frame] containing meteorological data. Its [colnames] should be equal to the IDof the basins
#' @export
#' @rdname ConvertMeteoSD
ConvertMeteoSD.GRiwrm <- function(x, meteo, ...) {
......@@ -22,6 +23,7 @@ ConvertMeteoSD.GRiwrm <- function(x, meteo, ...) {
return(meteoOut)
}
#' @param griwrm [GRiwrm] object describing the semi-distributive network
#' @export
#' @rdname ConvertMeteoSD
ConvertMeteoSD.character <- function(x, griwrm, meteo) {
......@@ -31,7 +33,6 @@ ConvertMeteoSD.character <- function(x, griwrm, meteo) {
}
upperIDs <- griwrm$id[upperBasins]
areas <- griwrm$area[match(c(x, upperIDs), griwrm$id)]
areas[1] <- sum(areas)
output <- ConvertMeteoSD(
meteo[,c(x, upperIDs), drop = FALSE],
areas = areas
......@@ -39,6 +40,8 @@ ConvertMeteoSD.character <- function(x, griwrm, meteo) {
return(output)
}
#' @param areas [numeric] vector with the total area of the basin followed by the areas of the upstream basins in km<sup>2</sup>
#' @param temperature [logical] `TRUE` if the meteorological data is temperature. if `FALSE` minimum output values are bounded to zero
#' @export
#' @rdname ConvertMeteoSD
ConvertMeteoSD.matrix <- function(x, areas, temperature = FALSE) {
......
Supports Markdown
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