Commit a8c2d08d authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.12.24 UPDATE: ErrorCrit* funs now use VarObs argument of CreateRunOptions instead varObs

parent 1d026a06
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.12.23 Version: 1.2.12.24
Date: 2019-04-01 Date: 2019-04-01
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -13,7 +13,7 @@ output: ...@@ -13,7 +13,7 @@ output:
### 1.2.12.23 Release Notes (2019-04-01) ### 1.2.12.24 Release Notes (2019-04-01)
......
...@@ -15,7 +15,7 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T ...@@ -15,7 +15,7 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Initialisation_________________________________ ##Initialisation_________________________________
CritName <- NA CritName <- NA
CritVar <- InputsCrit$varObs CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") { if (InputsCrit$transfo == "") {
CritName <- "KGE[CritVar]" CritName <- "KGE[CritVar]"
} }
...@@ -41,13 +41,13 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T ...@@ -41,13 +41,13 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________ ##Data_preparation_______________________________
VarObs <- InputsCrit$Obs VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") { if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim VarSim <- OutputsModel$Qsim
} }
if (InputsCrit$varObs == "SCA") { if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
} }
if (InputsCrit$varObs == "SWE") { if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
} }
VarSim[!InputsCrit$BoolCrit] <- NA VarSim[!InputsCrit$BoolCrit] <- NA
......
...@@ -15,7 +15,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -15,7 +15,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Initialisation_________________________________ ##Initialisation_________________________________
CritName <- NA CritName <- NA
CritVar <- InputsCrit$varObs CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") { if (InputsCrit$transfo == "") {
CritName <- "KGE'[CritVar]" CritName <- "KGE'[CritVar]"
} }
...@@ -41,13 +41,13 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -41,13 +41,13 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________ ##Data_preparation_______________________________
VarObs <- InputsCrit$Obs VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") { if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim VarSim <- OutputsModel$Qsim
} }
if (InputsCrit$varObs == "SCA") { if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
} }
if (InputsCrit$varObs == "SWE") { if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
} }
VarSim[!InputsCrit$BoolCrit] <- NA VarSim[!InputsCrit$BoolCrit] <- NA
......
...@@ -15,7 +15,7 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T ...@@ -15,7 +15,7 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Initialisation_________________________________ ##Initialisation_________________________________
CritName <- NA CritName <- NA
CritVar <- InputsCrit$varObs CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") { if (InputsCrit$transfo == "") {
CritName <- "NSE[CritVar]" CritName <- "NSE[CritVar]"
} }
...@@ -41,13 +41,13 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T ...@@ -41,13 +41,13 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________ ##Data_preparation_______________________________
VarObs <- InputsCrit$Obs VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") { if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim VarSim <- OutputsModel$Qsim
} }
if (InputsCrit$varObs == "SCA") { if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
} }
if (InputsCrit$varObs == "SWE") { if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
} }
VarSim[!InputsCrit$BoolCrit] <- NA VarSim[!InputsCrit$BoolCrit] <- NA
......
...@@ -15,7 +15,7 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -15,7 +15,7 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Initialisation_________________________________ ##Initialisation_________________________________
CritName <- NA CritName <- NA
CritVar <- InputsCrit$varObs CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") { if (InputsCrit$transfo == "") {
CritName <- "RMSE[CritVar]" CritName <- "RMSE[CritVar]"
} }
...@@ -41,13 +41,13 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -41,13 +41,13 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________ ##Data_preparation_______________________________
VarObs <- InputsCrit$Obs VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") { if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim VarSim <- OutputsModel$Qsim
} }
if (InputsCrit$varObs == "SCA") { if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
} }
if (InputsCrit$varObs == "SWE") { if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack")) VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
} }
VarSim[!InputsCrit$BoolCrit] <- NA VarSim[!InputsCrit$BoolCrit] <- NA
......
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